Vector problem

class EnemyShips
{
glm::vec2 position;
glm::vec2 dimension;
};

main()
{
std::vector<EnemyShips*> m_ships; - with 5-6 elements
}

How do i get position from element in vector?
m_ships[which_ship_index].position; //but, position is private here, you need to make it public or use a function to access or something...

assuming position is a container as well, so its probably one more layer to access your data ..

m_ships[which_ship_index].position[x]; //something here, is it an array or class with a get_x() function or something?
Last edited on
Topic archived. No new replies allowed.