Changeset View
Changeset View
Standalone View
Standalone View
ksirk/GameLogic/aiplayer.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | class AIPlayer : public Player | 44 | class AIPlayer : public Player | ||
45 | { | 45 | { | ||
46 | Q_OBJECT | 46 | Q_OBJECT | ||
47 | 47 | | |||
48 | public: | 48 | public: | ||
49 | /** | 49 | /** | ||
50 | * Constructor with simple initializations | 50 | * Constructor with simple initializations | ||
51 | */ | 51 | */ | ||
52 | AIPlayer( | 52 | explicit AIPlayer( | ||
53 | const QString & nomPlayer, unsigned int nbArmies, | 53 | const QString & nomPlayer, unsigned int nbArmies, | ||
54 | Nationality * myNation, PlayersArray& players, ONU* world, | 54 | Nationality * myNation, PlayersArray& players, ONU* world, | ||
55 | GameAutomaton* game ); | 55 | GameAutomaton* game ); | ||
56 | 56 | | |||
57 | /** Default destructor. */ | 57 | /** Default destructor. */ | ||
58 | ~AIPlayer() override; | 58 | ~AIPlayer() override; | ||
59 | 59 | | |||
60 | /** | 60 | /** | ||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | |||||
132 | 132 | | |||
133 | protected: // Private attributes | 133 | protected: // Private attributes | ||
134 | class MyThread: public QThread | 134 | class MyThread: public QThread | ||
135 | { | 135 | { | ||
136 | protected: | 136 | protected: | ||
137 | void run () override; | 137 | void run () override; | ||
138 | 138 | | |||
139 | public: | 139 | public: | ||
140 | MyThread(AIPlayer& p) : me(p) {} | 140 | explicit MyThread(AIPlayer& p) : me(p) {} | ||
141 | void setStopMe ( bool value ) { stopMe = value; } | 141 | void setStopMe ( bool value ) { stopMe = value; } | ||
142 | private: | 142 | private: | ||
143 | /** indicates to the thread if the run method should return */ | 143 | /** indicates to the thread if the run method should return */ | ||
144 | bool stopMe; | 144 | bool stopMe; | ||
145 | AIPlayer& me; | 145 | AIPlayer& me; | ||
146 | }; | 146 | }; | ||
147 | 147 | | |||
148 | AIPlayerIO* aiPlayerIO(); | 148 | AIPlayerIO* aiPlayerIO(); | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |