File: keeper.h

package info (click to toggle)
flying 6.20-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 752 kB
  • ctags: 1,873
  • sloc: cpp: 10,966; makefile: 189
file content (71 lines) | stat: -rw-r--r-- 1,352 bytes parent folder | download | duplicates (4)
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
#ifndef _keeper_h
#define _keeper_h

#ifndef _real_h
#	include "real.h"
#endif

class Ball;
class Wall;


class Keeper {
	public:
		Keeper(const Real &size_int, const Real &frame_in, ColorId frame_col, ColorId table_col);
		virtual ~Keeper();

		virtual void Draw() = 0;
		virtual void GameWasReset();

		void TakeOffBoard(Ball *b);

		static int IsOffBoard(Ball *b);
		static Ball *GetBack(Ball *b);

	protected:
		virtual void PlaceOffBoard(Ball *b) = 0;

		int		off_count;
		ColorId	frame_col;
		ColorId	table_col;
		Real		size;			// Hoehe oder Breite
		Real		frame;		// Breite des Rahmens
};


#define	UPPER_FLAG		0x01
#define	CLOSE_LEFT		0x02
#define	CLOSE_RIGHT		0x04

class LineKeeper : public Keeper {
	public:
		LineKeeper(const Real &height, const Real &frame, ColorId frame_col, ColorId table_col=0, int mode=CLOSE_LEFT);
		virtual ~LineKeeper();
		virtual void Draw();

	protected:
		virtual void PlaceOffBoard(Ball *b);
		int mode;

		Wall	*wall1,*wall2;
};


#define	LEFT_FLAG		0x01
#define	CLOSE_TOP		0x02
#define	CLOSE_BOT		0x04

class StackKeeper : public Keeper {
	public:
		StackKeeper(const Real &width, const Real &frame, ColorId frame_col, ColorId table_col=0, int mode=CLOSE_BOT);
		virtual ~StackKeeper();
		virtual void Draw();

	protected:
		virtual void PlaceOffBoard(Ball *b);
		int mode;

		Wall	*wall1, *wall2;
};

#endif