fixme: adding public SceneNode to the entity class makes compilation impossible

This commit is contained in:
Krzysztof Rudnicki 2022-01-23 19:45:48 +01:00
parent fd449af98e
commit 00fa8b926f
6 changed files with 11 additions and 10 deletions

View File

@ -1,7 +1,6 @@
#ifndef SCENE_NODE_CPP #ifndef SCENE_NODE_CPP
#define SCENE_NODE_CPP #define SCENE_NODE_CPP
#include "scenenode.hpp"
void SceneNode::attachChild(ScenePointer child) // takes ownership of the scene node void SceneNode::attachChild(ScenePointer child) // takes ownership of the scene node
{ {

View File

@ -29,6 +29,6 @@ class SceneNode : public sf::Transformable, public sf::Drawable, private sf::Non
}; };
#include "scenenode.cpp" #include "SceneNode.cpp"
#endif #endif

Binary file not shown.

View File

@ -1,15 +1,17 @@
#ifndef ENTITY_HPP #ifndef ENTITY_HPP
#define ENTITY_HPP #define ENTITY_HPP
#include "SceneNode.hpp"
#include "SceneNode.cpp"
class Entity class Entity : public SceneNode
{ {
public: public:
void SetVelocity(sf::Vector2f velocity); void SetVelocity(sf::Vector2f velocity);
void setVelocity(float velocityX, float velocityY); void setVelocity(float velocityX, float velocityY);
sf::Vector2f getVelocity() const; sf::Vector2f getVelocity() const;
private: private:
sf::Vector2f mVelocity; // default ocnstructor initializes this vector to a zero vector sf::Vector2f mVelocity; // default ocnstructor initializes this vector to a zero vector
}; };

View File

@ -5,9 +5,9 @@
#include <SFML/Graphics.hpp> #include <SFML/Graphics.hpp>
#include "constants.hpp" #include "constants.hpp"
#include "resources.hpp" #include "resources.hpp"
#include "SceneNode.hpp"
#include "entity.hpp" #include "entity.hpp"
#include "aircraft.hpp" #include "aircraft.hpp"
#include "scenenode.hpp"
#include "basic.cpp" #include "basic.cpp"

Binary file not shown.