From b53826079429939cdfbda073608cb85be8ba0738 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 7 Mar 2015 11:29:57 -0500 Subject: Created entity-component system Also tweaked the bloom flicker, tweaked the scanline texture, created a second test map, and created some currently unused sound effects. --- src/world.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/world.cpp (limited to 'src/world.cpp') diff --git a/src/world.cpp b/src/world.cpp new file mode 100644 index 0000000..90d9ab8 --- /dev/null +++ b/src/world.cpp @@ -0,0 +1,32 @@ +#include "world.h" + +void World::tick() +{ + for (auto it = entities.begin(); it != entities.end(); it++) + { + (*it)->tick(); + } +} + +void World::input(int key, int action) +{ + for (auto it = entities.begin(); it != entities.end(); it++) + { + (*it)->input(key, action); + } +} + +void World::render(Texture* buffer) +{ + fillTexture(buffer, NULL, 0, 0, 0); + + for (auto it = entities.begin(); it != entities.end(); it++) + { + (*it)->render(buffer); + } +} + +void World::addEntity(std::shared_ptr e) +{ + entities.push_back(e); +} -- cgit 1.4.1