diff --git a/include/entity/character.h b/include/entity/character.h new file mode 100644 index 0000000..9399e5f --- /dev/null +++ b/include/entity/character.h @@ -0,0 +1,33 @@ +#ifndef CHARACTER_H +#define CHARACTER_H +#include "controlable.h" +#include "drawable_handler.h" +#include "physical_entity.h" +#include "schedulable.h" + +class Character : Controllable, DrawableHandler, Physical_entity, Schedulable +{ +private: + /* data */ +public: + + virtual void sendEvent( sf::Event e ); + + + Character(/* args */); + ~Character(); +}; + +Character::Character(/* args */) +{ +} + +Character::~Character() +{ +} + + + + + +#endif \ No newline at end of file diff --git a/include/entity/controlable.h b/include/entity/controlable.h new file mode 100644 index 0000000..ff83146 --- /dev/null +++ b/include/entity/controlable.h @@ -0,0 +1,32 @@ +#ifndef CONTROLLABLE_H +#define CONTROLLABLE_H +#include + + +class Controllable +{ +private: + +public: + Controllable(/* args */); + ~Controllable(); + + virtual void sendEvent(sf::Event e); + +}; + +Controllable::Controllable(/* args */) +{ +} + +Controllable::~Controllable() +{ +} + + + + + + + +#endif \ No newline at end of file diff --git a/include/entity/drawable_handler.h b/include/entity/drawable_handler.h index 2c989e2..41e0e42 100644 --- a/include/entity/drawable_handler.h +++ b/include/entity/drawable_handler.h @@ -8,7 +8,7 @@ class DrawableHandler : public sf::Drawable { private: std::vector toDraw; - virtual void DrawableHandler::draw(sf::RenderTarget& target, sf::RenderStates states) const { + virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const { for(sf::Drawable* d : toDraw){ target.draw(*d,states); } diff --git a/include/entity/physical_entity.h b/include/entity/physical_entity.h index be0784d..d90717e 100644 --- a/include/entity/physical_entity.h +++ b/include/entity/physical_entity.h @@ -1,7 +1,40 @@ #ifndef PHYSICAL_ENTITY #define PHYSICAL_ENTITY +#include +typedef struct +{ + /* collider stuff ( e.g. linked list of vertex) */ +} Collider; + + + +class Physical_entity +{ +private: + sf::Vector2f pos; + float rot; + + Collider bndBox; +public: + + virtual void updatePhysics(); //here some kind of phx::PhysicsHandler; + void getCollider(); + void setCollider(Collider newCollider); + + Physical_entity(/* args */); + ~Physical_entity(); +}; + +Physical_entity::Physical_entity(/* args */) +{ +} + +Physical_entity::~Physical_entity() +{ +} + #endif \ No newline at end of file diff --git a/include/entity/schedulable.h b/include/entity/schedulable.h new file mode 100644 index 0000000..3c36e39 --- /dev/null +++ b/include/entity/schedulable.h @@ -0,0 +1,50 @@ +#ifndef SCHEDULABLE.H +#define SCHEDULABLE.H +#include +#include +#include + +class Schedulable +{ +private: + + std::multimap > actions; // actions to do at a given frame (contains a frame and a function to call) + // Maybe a Circular buffer would be better ? +public: + + + + void update(int frame) + /* + { + + if(actions.count(frame) > 0){ + + for(std::function currentAction : (actions.find(frame)) ){ + + } + } + + } */; // call this one each frame + + void addAction(int frame, std::function action); + + + Schedulable(/* args */); + ~Schedulable(); +}; + +Schedulable::Schedulable(/* args */) +{ +} + +Schedulable::~Schedulable() +{ +} + + + + + + +#endif \ No newline at end of file diff --git a/include/entity/wall.h b/include/entity/wall.h new file mode 100644 index 0000000..b4da880 --- /dev/null +++ b/include/entity/wall.h @@ -0,0 +1,28 @@ +#ifndef WALL_H +#define WALL_H +#include "drawable_handler.h" +#include "physical_entity.h" + + + +class Wall: DrawableHandler, Physical_entity +{ +private: + /* data */ +public: + Wall(/* args */); + ~Wall(); +}; + +Wall::Wall(/* args */) +{ +} + +Wall::~Wall() +{ +} + + + + +#endif \ No newline at end of file