home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Games / flying-6.11 / snooker.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-30  |  1.2 KB  |  66 lines

  1. #ifndef _snooker_h
  2. #define _snooker_h
  3.  
  4. #ifndef _vec2_h
  5. #    include "vec2.h"
  6. #endif
  7. #ifndef _pool_h
  8. #    include "pool.h"
  9. #endif
  10.  
  11. class Snooker : public Pool {
  12.     public:
  13.         static Real TableWidth;
  14.         static Real TableHeight;
  15.         static Real BallRadius;
  16.  
  17.         Snooker(double dx=TableWidth, double dy=TableHeight);
  18.         virtual ~Snooker();
  19.  
  20.         virtual void InitPlayground();
  21.         virtual void DrawBackground() const;
  22.         virtual const Real & GetNormalBallSize() const;
  23.  
  24.         ColorId        red_col;
  25.         ColorId        cols[6];
  26.  
  27.         virtual void InPocket( Ball *b );
  28.         virtual void AllBallsStopped();
  29.         virtual int  IsSelectable( Ball *b );
  30.  
  31.     protected:
  32.  
  33.         void SetupBalls();
  34.         void Triangle( double x, double y );
  35.         void Triangle( const Vec2 &v )    { Triangle(v.X(),v.Y()); }
  36.  
  37.         Ball    *red[15];
  38.         Ball    *colored[6];
  39.  
  40.         Vec2    defs[6];        // Default-Positionen
  41.  
  42.         int    reds_in_pocket;
  43.         int    color_in_pocket;
  44. };
  45.  
  46. class SnookerDemo : public Snooker {
  47.     public:
  48.         SnookerDemo( double s=100.0 ) : shot_speed(s)    {}
  49.         virtual ~SnookerDemo();
  50.  
  51.         virtual const Real &GetPresetA() const;
  52.         virtual const Real &GetSlowGranularity() const;
  53.  
  54.         virtual void InitPlayground();
  55.         virtual void DrawBackground() const;
  56.  
  57.     private:
  58.         Real            shot_speed;
  59.  
  60.     public:
  61.         static Real    PresetA;
  62.         static Real    SlowGranularity;
  63. };
  64.  
  65. #endif
  66.