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
00012 int x_coord[26];
00013 int yup_coord[15];
00014 int ylow_coord[15];
00015 int z_coord[15];
00016
00017 int x_fin1[3];
00018 int x_fin2[3];
00019 int y_fin[5];
00020 int z_fin;
00021
00022
00023
00024
00025
00026 Population population[28];
00027 AISettings ai;
00028
00029 int player;
00030 int otherplayer;
00031 int dice[4];
00032
00033 int marker_current;
00034 int marker_next[4];
00035
00036 bool allclear[3];
00037
00038 bool pieces_out[3];
00039 bool move_with_pieces_out;
00040
00041 bool nice_dice;
00042 int last_piece[3];
00043
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