Advertisement
Guest User

Lemming h

a guest
Mar 22nd, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #pragma once
  2. class Lemming
  3. {
  4. public:
  5.     Lemming(int ID, int x, int y);
  6.     ~Lemming();
  7.     int getX();
  8.     int getY();
  9.     int getdirectionX();
  10.     int getdirectionY();
  11.    
  12.  
  13.     void setX(int x);
  14.     void setY(int y);
  15.     void setdirectionX(int dirX);
  16.     void setdirectionY(int dirY);
  17.  
  18. private:
  19.     int ID;
  20.     int posx, posy;
  21.     bool safe;
  22.     bool alive;
  23.     bool spawned;
  24.     int directionX;
  25.     int directionY;
  26.  
  27.  
  28. };
  29. inline Lemming::Lemming(int ID, int x, int y) : ID(ID), posx(x), posy(y), safe(false), alive(true), spawned(true),  directionX(0), directionY(1){};
  30.  
  31. inline int Lemming ::getX() { return posx; };
  32. inline int Lemming::getY() { return posy; };
  33.  
  34. inline void Lemming::setX(int x) { posx = x; };
  35. inline void Lemming::setY(int y) { posy = y; };
  36.  
  37. inline int Lemming::getdirectionX() { return directionX; };
  38. inline int Lemming::getdirectionY() { return directionY; };
  39.  
  40. inline void Lemming :: setdirectionX(int dirX) { directionX = dirX; };
  41. inline void Lemming::setdirectionY(int dirY) { directionY = dirY; };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement