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

field.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           field.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 __FIELD_H
00020 #define __FIELD_H
00021 
00022 #include <qobject.h>
00023 #include <qwidget.h>
00024 #include "cell.h"
00025 
00026 // size of game field
00027 #define NUMCELLSW 11
00028 #define NUMCELLSH 11
00029 
00030 class Field: public QWidget
00031 {
00032   Q_OBJECT
00033 public:
00034   void clearField();
00035 
00036 protected:
00037   Field(QWidget* parent, const char* name);
00038   ~Field();
00039 
00040   void putBall(int x, int y, int color);
00041   void putBallRun(int x, int y, int color);
00042   void removeBall(int x, int y );
00043   int getBall(int x, int y);
00044   int getAnim(int x, int y);
00045   void setAnim(int x, int y, int anim );
00046   void clearAnim();
00047   int deleteAnimatedBalls();
00048   void moveBall(int xa, int ya, int xb, int yb);
00049 
00050   bool checkBounds( int x, int y );
00051 //  virtual int erase5Balls(){ return 0;}
00052   int freeSpace();
00053         void saveUndo();
00054         void restoreUndo();
00055 
00056 private:
00057   Cell field[NUMCELLSH][NUMCELLSW];
00058   Cell field_undo[NUMCELLSH][NUMCELLSW];
00059 //  void search5Balls();
00060 
00061 };
00062 
00063 #endif

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