File: gboard.h

package info (click to toggle)
pacman 10-13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 664 kB
  • ctags: 1,108
  • sloc: cpp: 3,333; makefile: 502; sh: 96
file content (86 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef __gboard_h_ 
#define __gboard_h_
 #include"object.h"
 #include"graphele.h"
#include"gblank.h"
#include"vertwall.h"
#include"horiwall.h"
#include"cross.h"
#include"gspecwal.h"
#include"gfood.h"
#include"gsupfood.h"
#include"e0.h"
#include"e90.h"
#include"e180.h"
#include"e270.h"
#include"t0.h"
#include"t90.h"
#include"t180.h"
#include"t270.h"
#include"corner1.h"
#include"corner2.h"
#include"corner3.h"
#include"corner4.h"
#include"sizes.h"
#include"usrinter.h"
#include"types.h"

#include"element.h"
#include"dynamiel.h"

class G_Board : public Object {

//pointers to the graphic elements

static G_Blank* blank;
static VerticalWall* vertical;
static HorizontalWall* horizontal;
static Cross* cross;
static G_SpecialWall* specwall;
static G_Food* food;
static G_SuperFood* superfood;
static E0* e0;
static E90* e90;
static E180* e180;
static E270* e270;
static T0* t0;
static T90* t90;
static T180* t180;
static T270* t270;
static Corner1* corner1;
static Corner2* corner2;
static Corner3* corner3;
static Corner4* corner4;

int eqpat(char [3][3],char[10]);	//equality with wildcard

char pattern(char [BOARDHEIGHT+1][BOARDWIDTH+1],int,int);
 //in:board with coordinates, out: the belonging code for the graphic element

GraphElement *chartograph(char);
 //"translates" graphic element code to pointer to it

static G_Board* _instance;	 //pointer to the instance of the board
 protected:

 G_Board();             	//constructor
 
 public:

 static G_Board* instance();	//returns the pointer to the instance 
 ~G_Board();			//destructor

 GraphElement *graphele(char [BOARDHEIGHT+1][BOARDWIDTH+1],int,int);
  //translates board info to pointer to graphic element

 GraphElement *graphele(char);
  //the same
};

#endif