From 879c2c04d9c3879f871cfe79f9b25fd23c5184b4 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 11 Jun 2015 11:38:49 -0400 Subject: Wrote EntityManager --- src/entity.h | 64 ------------------------------------------------------------ 1 file changed, 64 deletions(-) delete mode 100644 src/entity.h (limited to 'src/entity.h') diff --git a/src/entity.h b/src/entity.h deleted file mode 100644 index 7f09f2d..0000000 --- a/src/entity.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef ENTITY_H -#define ENTITY_H - -#include -#include "renderer.h" - -class Game; -class Map; -class Entity; -class Component; - -class Message { - public: - enum class Type { - walkLeft, - walkRight, - stopWalking, - setHorizontalVelocity, - setVerticalVelocity, - collision, - jump, - stopJump, - drop, - canDrop, - cantDrop, - die, - stopDying, - hitTheGround - }; - - Message(Type type) : type(type) {} - - Type type; - Entity* collisionEntity; - int dropAxis; - double velocity; -}; - -class Entity { - public: - void addComponent(std::shared_ptr c); - void send(Game& game, const Message& msg); - void tick(Game& game, double dt); - void input(Game& game, int key, int action); - void render(Game& game, Texture& buffer); - void detectCollision(Game& game, Entity& collider, std::pair old_position); - - std::pair position; - std::pair size; - - private: - std::list> components; -}; - -class Component { - public: - virtual void receive(Game&, Entity&, const Message&) {} - virtual void render(Game&, Entity&, Texture&) {} - virtual void tick(Game&, Entity&, double) {} - virtual void input(Game&, Entity&, int, int) {} - virtual void detectCollision(Game&, Entity&, Entity&, std::pair) {} -}; - -#endif -- cgit 1.4.1