Class structure, updated UML
Missing : actual code, decorators
This commit is contained in:
parent
2b9593bee8
commit
67435debe6
9 changed files with 113 additions and 10 deletions
48
src/Entity.h
48
src/Entity.h
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue