Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

moveengine.h

Go to the documentation of this file.
00001 #ifndef MOVEENGINE_H
00002 #define MOVEENGINE_H
00003 
00004 #include "definition.h"
00005 #include <qobject.h>
00006 
00007 class MoveEngine : public QObject
00008 {
00009     Q_OBJECT
00010 private:
00011     //normal pieses
00012     int x_coord[26]; //26 posssible x-positions or piece is not on the board
00013     int yup_coord[15]; // the 15 posssible y-positions on the upper half of the board
00014     int ylow_coord[15]; // the 15 posssible y-positions on the lower half of the board
00015     int z_coord[15]; //the 15 possible z-positionson the board
00016     //finshed pieces
00017     int x_fin1[3];
00018     int x_fin2[3];
00019     int y_fin[5];
00020     int z_fin;
00021     //the board population
00022     // |12|11|10|09|08|07|06|05|04|03|02|01|00|
00023     // =======================================
00024     // |13|14|15|16|17|18|19|20|21|22|23|24|25|
00025     // endzones 26 player1, 27 player 2
00026     Population population[28];
00027     AISettings ai;
00028     //move information
00029     int player;
00030     int otherplayer;
00031     int dice[4];
00032     //index of the markers
00033     int marker_current;
00034     int marker_next[4];
00035     //player pieces are all in the end zone
00036     bool allclear[3];
00037     //player must bring pieces back into game
00038     bool pieces_out[3];
00039     bool move_with_pieces_out;
00040     //player can rescue pieces with dice bigger than move, even if there are poeces "behind" it
00041     bool nice_dice;
00042     int last_piece[3];
00043     //possible moves
00044     Possiblilites moves[26];
00045 public:
00046 public:
00047     MoveEngine();
00048     ~MoveEngine();
00049 signals:
00050     void done_dice1();
00051     void done_dice2();
00052     void done_dice3();
00053     void done_dice4();
00054     void nomove();
00055     void player_finished(int);
00056 private slots:
00057     void automove();
00058 public:
00059     void position(Pieces& pieces,bool non_qte=false);
00060     void diceroll(const int& player,const int& face1,const int& face2,const int& face3,const int& face4,bool computer);
00061     void boardpressed(const int& x,const int& y,Marker& marker,bool non_qte=false);
00062     void reset();
00063     void loadGame(const LoadSave& load);
00064     LoadSave saveGame();
00065     AISettings getAISettings();
00066     void setAISettings(const AISettings& new_ai);
00067     void setRules(Rules rules);
00068 private:
00069     int getPossibleMoves();
00070     void move(const int& from, int to, const int& dice);
00071     void checkstate();
00072     void nomarker(Marker& marker);
00073     int fieldColor(const int& index) const;
00074 };
00075 
00076 #endif //MOVEENGINE_H

Generated on Sat Nov 5 16:17:18 2005 for OPIE by  doxygen 1.4.2