1 /*
2  *  Copyright (C) 2011-2016  OpenDungeons Team
3  *
4  *  This program is free software: you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation, either version 3 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef PLAYERSELECTION_H
19 #define PLAYERSELECTION_H
20 
21 enum class RoomType;
22 enum class TrapType;
23 enum class SpellType;
24 
25 enum class SelectedAction
26 {
27     none,
28     buildRoom,
29     buildTrap,
30     castSpell,
31     changeTile,
32     selectTile,
33     destroyRoom,
34     destroyTrap
35 };
36 
37 //! \brief Class to store what the client-side player has currently selected.
38 class PlayerSelection
39 {
40 public:
41     PlayerSelection();
42 
getCurrentAction()43     inline SelectedAction getCurrentAction() const
44     { return mCurrentAction; }
45 
46     //! \brief Set the players current action. This also resets room/trap/spell type.
47     void setCurrentAction(SelectedAction action);
48 
getNewRoomType()49     inline RoomType getNewRoomType() const
50     { return mNewRoomType; }
51 
setNewRoomType(RoomType newRoomType)52     inline void setNewRoomType(RoomType newRoomType)
53     { mNewRoomType = newRoomType; }
54 
getNewTrapType()55     inline TrapType getNewTrapType() const
56     { return mNewTrapType; }
57 
setNewTrapType(TrapType newTrapType)58     inline void setNewTrapType(TrapType newTrapType)
59     { mNewTrapType = newTrapType; }
60 
getNewSpellType()61     inline SpellType getNewSpellType() const
62     { return mNewSpellType; }
63 
setNewSpellType(SpellType newSpellType)64     inline void setNewSpellType(SpellType newSpellType)
65     { mNewSpellType = newSpellType; }
66 
67 private:
68     //! \brief Room, trap or Spell tile type the player has currently selected for an action
69     RoomType mNewRoomType;
70     TrapType mNewTrapType;
71     SpellType mNewSpellType;
72     SelectedAction mCurrentAction;
73 };
74 
75 #endif // PLAYERSELECTION_H
76