1 /* 2 * Copyright (C) 2011-2012 Me and My Shadow 3 * 4 * This file is part of Me and My Shadow. 5 * 6 * Me and My Shadow is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, either version 3 of the License, or 9 * (at your option) any later version. 10 * 11 * Me and My Shadow is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with Me and My Shadow. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #ifndef SHADOW_H 21 #define SHADOW_H 22 23 #include "Player.h" 24 25 //The shadow class, it extends the player class since their almost the same. 26 class Shadow : public Player{ 27 protected: 28 //Boolean if the shadow is called by the player. 29 //If so the shadow will copy the moves the player made. 30 bool called,calledSaved; 31 32 friend class Player; 33 public: 34 //Constructor, it sets a few variables and calls the Player's constructor. 35 //objParent: Pointer to the game instance. 36 Shadow(Game* objParent); 37 38 //Method that's called before the move function. 39 //It's used to let the shadow do his logic, moving and jumping. 40 void moveLogic(); 41 42 //Method used to notify the shadow that he is called. 43 //He then must copy the moves that are given to him. 44 void meCall(); 45 46 //Method used to reset the state. 47 virtual void stateReset(); 48 //Method used to save the state. 49 virtual void saveState(); 50 //Method used to load the state. 51 virtual void loadState(); 52 }; 53 #endif 54