Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BoardState{
- Creature creatures[1000];
- int numOfCreatures;
- Tower towers[300];
- int numOfTowers;
- Map map;
- void draw();
- };
- class Creature{
- int speed;
- int maxHitPoints;
- int hitPoints;
- int x;
- int y;
- virtual void toDo(const BoardState& board) = 0;
- void move();
- };
- class Runner: public Creature{
- void toDo(const BoardState& board) override {
- this->move();
- }
- };
- class RunnerTier1Mode1: public Runner{
- };
- class Healer: public Creature{
- int healRadius;
- int healPower;
- void toDo(const BoardState& board) override {
- for(int i = 0; i < board.creatures.size; i++) {
- if (dist(board.cratures[i], *this) < healRadius) {
- board.creatures[i].heal(healPower);
- }
- }
- this->move();
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement