1 #ifndef _pool_h
2 #define _pool_h
3 
4 #ifndef _real_h
5 #	include "real.h"
6 #endif
7 #ifndef _billard_h
8 #	include "billard.h"
9 #endif
10 
11 class Pocket;
12 class PocketConnector;
13 
14 class Pool : public Billard {
15 	public:
16 		static Real TableWidth;
17 		static Real TableHeight;
18 
19 	public:
20 		Pool(double dx=TableWidth, double dy=TableHeight);
21 		virtual ~Pool();
22 
23 		void InitArea( double wx, double wy );
24 		void InitTable( double Rad = 0.0 );
25 		virtual void InitPlayground();
26 		virtual void DrawBackground() const;
27 
28 		virtual int SelectTable( int col );
29 
30 		virtual const Real & GetNormalBallSize() 		const;
31 
32 		virtual void ResetGame();
33 		virtual void InPocket( Ball *b );
34 		virtual void AllBallsStopped();
35 		virtual int  IsSelectable(Ball *b);
36 
37 	protected:
38 		Pocket				*p[6];
39 		Ball					*cueball;
40 		Vec2					cuedef;				// Default for cueball
41 		Vec2					tridef;				// Triangle-Position
42 
43 		int	cue_in_pocket;
44 
45 		void Triangle( double x, double y );
46 						 Real po;					// Offset von KeeperLine
47 
48 		ColorId		cue_col;
49 		ColorId		pocket_col;
50 
51 	private:
52 		static const int  nPockets;
53 
54 		PocketConnector	*pcon;
55 
56 
57 	public:
58 		static Real Offset;
59 		static Real PocketRadius;
60 		static Real BallRadius;
61 		static Real EdgeRadius;
62 		static Real EdgeAngle;
63 		static Real MidAngle;
64 		static Real	PocketHeight;
65 		static Real PocketFrame;
66 };
67 
68 #endif
69