added elements in unit, map, game

This commit is contained in:
ProgramSnail 2021-04-12 01:51:12 +03:00
parent 220dd71d8f
commit 733bcbd99d
10 changed files with 116 additions and 16 deletions

View file

@ -1,22 +1,36 @@
#include <vector>
#include "../game_map.hpp"
#include "../game_events.hpp"
#include "unit_module.hpp"
#include "../map_entities/unit_obj.hpp"
#pragma once
namespace unit {
class Unit {
private:
const size_t MEMORY_SIZE = 100;
// parts of unit, that do something
std::vector<Module> modules;
// memory, help modules communicate and handle events
std::vector<int> memory;
map::UnitObj unitObj;
map::GameMap* map;
public:
Unit();
void update();
events::EventCenter* eventCenter;
public:
Unit(map::GameMap* map, events::EventCenter* eventCenter);
void step();
size_t addModule(Module module);
void removeModule(size_t id);
void damage();
};
}