Class structure, updated UML

Missing : actual code, decorators
This commit is contained in:
trotFunky 2019-06-06 21:30:39 +02:00
parent 2b9593bee8
commit 67435debe6
9 changed files with 113 additions and 10 deletions

View file

@ -5,9 +5,55 @@
#ifndef SRC_ENTITY_H
#define SRC_ENTITY_H
#include <SFML/Graphics.hpp>
class Entity {
enum class EntityType
{
Citizen,
Player,
House,
Car,
};
enum class State
{
Moving,
Fleeing,
Waiting,
Idle,
};
enum class Orientation
{
Nort,
East,
South,
West,
};
class Entity
{
public:
Entity();
void render(sf::RenderWindow& renderWindow) const;
void move();
void update();
/// Position of the target of the current action on the map
sf::Vector2i target;
private:
// As it contains position, size and orientation, we do not need anything more
sf::RectangleShape shape;
State currentState;
/// Used with rules : last to update has priority
State nextState;
/// Used with rules : last to update has priority
sf::Vector2i nextTarget;
};