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.cpp | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 src/entity.cpp (limited to 'src/entity.cpp') diff --git a/src/entity.cpp b/src/entity.cpp deleted file mode 100644 index 2b6cd7f..0000000 --- a/src/entity.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "entity.h" - -void Entity::addComponent(std::shared_ptr c) -{ - components.push_back(c); -} - -void Entity::send(Game& game, const Message& msg) -{ - for (auto component : components) - { - component->receive(game, *this, msg); - } -} - -void Entity::tick(Game& game, double dt) -{ - for (auto component : components) - { - component->tick(game, *this, dt); - } -} - -void Entity::input(Game& game, int key, int action) -{ - for (auto component : components) - { - component->input(game, *this, key, action); - } -} - -void Entity::render(Game& game, Texture& buffer) -{ - for (auto component : components) - { - component->render(game, *this, buffer); - } -} - -void Entity::detectCollision(Game& game, Entity& collider, std::pair old_position) -{ - for (auto component : components) - { - component->detectCollision(game, *this, collider, old_position); - } -} -- cgit 1.4.1