00001 /*************************************************************************** 00002 linesboard.h - description 00003 ------------------- 00004 begin : Fri May 19 2000 00005 copyright : (C) 2000 by Roman Merzlyakov 00006 email : roman@sbrf.barrt.ru 00007 copyright : (C) 2000 by Roman Razilov 00008 email : Roman.Razilov@gmx.de 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 ***************************************************************************/ 00019 #ifndef __linesboard_h 00020 #define __linesboard_h 00021 00022 #include <qwidget.h> 00023 #include <qpixmap.h> 00024 #include <qtimer.h> 00025 00026 #include "field.h" 00027 //#include "shotcounter.h" 00028 #include "ballpainter.h" 00029 00030 class LinesBoard : public Field 00031 { 00032 Q_OBJECT 00033 public: 00034 LinesBoard( BallPainter * abPainter, QWidget* parent=0, const char* name=0 ); 00035 ~LinesBoard(); 00036 00037 int width(); 00038 int height(); 00039 int wHint(); 00040 int hHint(); 00041 // void doAfterBalls(); 00042 void placeBalls(int nextBalls[BALLSDROP]); 00043 void undo(); 00044 00045 signals: 00046 void endTurn(); 00047 void endGame(); 00048 void eraseLine(int nb); 00049 00050 private: 00051 int anim; 00052 00053 struct Waypoints { 00054 int x,y; 00055 } *way; 00056 int nextBalls[BALLSDROP]; 00057 00058 int animmax; 00059 00060 //used for running and animation phase 00061 int painting; 00062 int animstep; 00063 int animdelaycount; 00064 int animdelaystart; 00065 int direction; 00066 00067 00068 int nextBallToPlace; 00069 int jumpingCol; 00070 int jumpingRow; 00071 00072 00073 QTimer* timer; 00074 // ShotCounter* shCounter; 00075 BallPainter* bPainter; 00076 00077 void paintEvent( QPaintEvent* ); 00078 void mousePressEvent( QMouseEvent* ); 00079 00080 void AnimStart(int panim); 00081 void AnimNext(); 00082 int AnimEnd(); 00083 int getAnim(int x, int y ); // returns if the specifyed cell is animated.. 00084 void AnimJump( int col, int row ); 00085 00086 int erase5Balls(); 00087 bool existPath(int ax, int ay, int bx, int by); 00088 void placeBall(); 00089 00090 protected slots: 00091 void timerSlot(); 00092 00093 }; 00094 00095 #endif
1.4.2