00001 #ifndef ENGINE_TWO_H
00002 #define ENGINE_TWO_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <QObject>
00025
00026
00027
00028 #include <kdebug.h>
00029
00030
00031 #include "abstractengine.h"
00032 #include "deck.h"
00033
00034
00035 class DisplayTwo;
00036
00037 using namespace CardDeck;
00038
00039
00042 class EngineTwo : public AbstractEngine
00043 {
00044 Q_OBJECT
00045
00046 public:
00048 enum MoveState {FirstPlayerTurn=0, SecondPlayerTurn=1};
00049
00050
00051
00057 EngineTwo(QWidget* parent, Deck* deck, DisplayTwo* display);
00058
00059
00064 virtual void startGame(Suite trump, int startPlayer);
00065
00068 virtual void stopGame();
00069
00073 MoveState currentMovePhase() {return mCurrentMovePhase;}
00074
00079 int playedCard(int no) {return mCurrentMoveCards[no];}
00080
00081
00082 public slots:
00083
00089 virtual void playerInput(int inputId, int playerNumber, int cardNumber);
00090
00098 bool isLegalMove(int card1, int card2, int playerNumber);
00099
00104 int whoWonMove(int card1,int card2);
00105
00106
00107 protected slots:
00110 void gameLoopStart();
00111
00114 void gameLoopFinish();
00115
00116 protected:
00121 void activatePlayer(int playerNumber);
00122
00126 bool gameOver();
00127
00131 int evaluateGame();
00132
00133 private:
00134
00135 DisplayTwo* mDisplay;
00136
00137 Deck* mDeck;
00138
00139 int mCurrentMoveCards[2];
00140
00141 MoveState mCurrentMovePhase;
00142
00143 int mMoveNumber;
00144
00145 Suite mTrump;
00146
00147 };
00148
00149 #endif