-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added main entity functions prototypes
- Loading branch information
1 parent
2f9faa3
commit 58a30f9
Showing
6 changed files
with
177 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef CONTROLLABLE_H | ||
#define CONTROLLABLE_H | ||
#include <SFML/Window.hpp> | ||
|
||
|
||
class Controllable | ||
{ | ||
private: | ||
|
||
public: | ||
Controllable(/* args */); | ||
~Controllable(); | ||
|
||
virtual void sendEvent(sf::Event e); | ||
|
||
}; | ||
|
||
Controllable::Controllable(/* args */) | ||
{ | ||
} | ||
|
||
Controllable::~Controllable() | ||
{ | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
#ifndef PHYSICAL_ENTITY | ||
#define PHYSICAL_ENTITY | ||
#include <SFML/System/Vector2.hpp> | ||
|
||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#ifndef SCHEDULABLE.H | ||
#define SCHEDULABLE.H | ||
#include <queue> | ||
#include <functional> | ||
#include <map> | ||
|
||
class Schedulable | ||
{ | ||
private: | ||
|
||
std::multimap<int, std::function<void ()> > 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<void()> currentAction : (actions.find(frame)) ){ | ||
} | ||
} | ||
} */; // call this one each frame | ||
|
||
void addAction(int frame, std::function<void()> action); | ||
|
||
|
||
Schedulable(/* args */); | ||
~Schedulable(); | ||
}; | ||
|
||
Schedulable::Schedulable(/* args */) | ||
{ | ||
} | ||
|
||
Schedulable::~Schedulable() | ||
{ | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |