File: curling.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 (89 lines) | stat: -rw-r--r-- 1,708 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef _curling_h
#define _curling_h

#ifndef _vec2_h
#	include "vec2.h"
#endif
#ifndef _game_h
#	include "game.h"
#endif

#define	TEAMS		2
#define	CURLS		4

class BallMover;		// forward
class Goal;
class StaticBall;
class Wall;

class Curling : public Game {
	public:
		static Real	TableWidth;
		static Real TableHeight;

		Curling(double wx=TableWidth, double wy=TableHeight);
		virtual ~Curling();

		virtual const Real & GetPresetA() const;
		virtual const Real & GetPresetHaft() const;
		virtual const Real & GetSlowGranularity() const;

		virtual const Real & GetNormalBallSize() const;

		virtual const Real AreaOffX() const;
		virtual const Real AreaOffY() const;
		virtual const Real AreaWidth() const;
		virtual const Real AreaHeight() const;

		virtual void InitPlayground();
		virtual void DrawBackground() const;
		virtual void ResetGame();

		void InitArea( double wx, double wy );
		void InitTable();

		static Real PresetA;
		static Real PresetHaft;
		static Real SlowGranularity;

		static Real FrameOffset;
		static Real GoalSize;

		static Real Offset;
		static Real CurlRadius;
		static Real CurlWeight;

		static Real	KeeperFrame;	
		static Real KeeperHeight;

	protected:
		Real area_off_x;
		Real area_off_y;
		Real area_width;
		Real area_height;

		BallMover	*mcurl;

		ColorId		table_col;
		ColorId		black_bg_col;
		ColorId		red_bg_col;
		ColorId		blue_bg_col;

		ColorId		table_dark_col;
		ColorId		curl_col[TEAMS];

	protected:
		Vec2		mid;
		Vec2		edge[4];
		Goal		*goal;
		Wall		*w[3];

		Ball		*curl[TEAMS][CURLS];
		Vec2		curl_p[TEAMS][CURLS];

	private:
		Curling( const Curling& /*obj*/)						{}
		Curling &operator=( const Curling& /*obj*/ )		{ return *this; }
};

#endif