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

This commit is contained in:
PolishPigeon 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
#define SCENE_NODE_CPP
#include "scenenode.hpp"
void SceneNode::attachChild(ScenePointer child) // takes ownership of the scene node
{
@ -32,7 +31,7 @@ SceneNode::ScenePointer SceneNode::detachChild(const SceneNode& node) // finds n
void SceneNode::drawCurrent(sf::RenderTarget& target, sf::RenderStates states) const
{
}
void SceneNode::draw(sf::RenderTarget& target, sf::RenderStates states) const

View File

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

Binary file not shown.

View File

@ -1,15 +1,17 @@
#ifndef ENTITY_HPP
#define ENTITY_HPP
#include "SceneNode.hpp"
#include "SceneNode.cpp"
class Entity
class Entity : public SceneNode
{
public:
void SetVelocity(sf::Vector2f velocity);
void setVelocity(float velocityX, float velocityY);
sf::Vector2f getVelocity() const;
public:
void SetVelocity(sf::Vector2f velocity);
void setVelocity(float velocityX, float velocityY);
sf::Vector2f getVelocity() const;
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 "constants.hpp"
#include "resources.hpp"
#include "SceneNode.hpp"
#include "entity.hpp"
#include "aircraft.hpp"
#include "scenenode.hpp"
#include "basic.cpp"

Binary file not shown.