Player.h
1 #pragma once 2 #include "Creature.h" 3 4 enum PlayerType 5 { 6 PT_Knight = 1, 7 PT_Archer = 2, 8 PT_Mage = 3 9 }; 10 11 class Player : public Creature 12 { 13 public: 14 Player(int playerType) : Creature(CT_PLAYER), _playerType(playerType) 15 { 16 17 } 18 19 virtual ~Player() 20 { 21 22 } 23 24 virtual void PrintInfo(); 25 26 protected: 27 int _playerType; 28 }; 29 30 class Knight : public Player 31 { 32 public: 33 Knight() : Player(PT_Knight) 34 { 35 _hp = 150; 36 _attack = 10; 37 _defence = 5; 38 } 39 40 }; 41 42 class Archer : public Player 43 { 44 public: 45 Archer() : Player(PT_Archer) 46 { 47 _hp = 80; 48 _attack = 15; 49 _defence = 3; 50 } 51 }; 52 53 class Mage : public Player 54 { 55 public: 56 Mage() : Player(PT_Mage) 57 { 58 _hp = 50; 59 _attack = 25; 60 _defence = 0; 61 } 62 };