Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. class BoardState{
  2.     Creature creatures[1000];
  3.     int numOfCreatures;
  4.     Tower towers[300];
  5.     int numOfTowers;
  6.     Map map;
  7.     void draw();
  8. };
  9.  
  10.  
  11.  
  12. class Creature{
  13.     int speed;
  14.     int maxHitPoints;
  15.     int hitPoints;
  16.     int x;
  17.     int y;
  18.     virtual void toDo(const BoardState& board) = 0;
  19.     void move();
  20. };
  21.  
  22. class Runner: public Creature{
  23.     void toDo(const BoardState& board) override {
  24.         this->move();
  25.     }
  26. };
  27.  
  28. class RunnerTier1Mode1: public Runner{
  29.  
  30. };
  31.  
  32. class Healer: public Creature{
  33.     int healRadius;
  34.     int healPower;
  35.     void toDo(const BoardState& board) override {
  36.         for(int i = 0; i < board.creatures.size; i++) {
  37.             if (dist(board.cratures[i], *this) < healRadius) {
  38.                 board.creatures[i].heal(healPower);
  39.             }
  40.         }
  41.         this->move();
  42.     }
  43. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement