1 /* $Id: PlayGame.h,v 1.11 2003/07/16 16:09:10 nan Exp $ */
2 
3 // Copyright (C) 2000, 2001, 2002  $B?@Fn(B $B5H9((B(Kanna Yoshihiro)
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 
19 #ifndef _PlayGame_
20 #define _PlayGame_
21 
22 #include "Control.h"
23 #include "PlayGameView.h"
24 class Player;
25 
26 // Base class of SoloPlay, MultiPlay, Training
27 class PlayGame : public Control {
28 public:
29   PlayGame();
30   virtual ~PlayGame();
31 
32   virtual bool Init() = 0;
33 
34   virtual bool Move( SDL_keysym *KeyHistory, long *MouseXHistory,
35 		     long *MouseYHistory, unsigned long *MouseBHistory,
36 		     int Histptr ) = 0;
37   virtual bool LookAt( double &srcX, double &srcY, double &srcZ,
38 		       double &destX, double &destY, double &destZ ) = 0;
39 
IsPlaying()40   virtual bool IsPlaying() { return true; };
41 
IsPause()42   virtual bool IsPause() { return m_pause; };
43   virtual void SetPause( bool pause );
44 
45   long GetService();
46   long GetScore( Player *p );
47   long GetScore( long side );
48   long GetGame( Player *p );
49   long GetGame( long side );
50 
51   bool IsGameEnd();
52   virtual void EndGame();
53   void ChangeScore();
54   void ChangeScore( long score1, long score2 );
55 
GetView()56   virtual View *GetView() { return m_View; };
57 protected:
58   PlayGameView *m_View;
59 
60   long m_Score1;	// Point of near side. Counter when training
61   long m_Game1;		// Game of near side.
62   long m_Score2;	// Point of far side
63   long m_Game2;		// Game of far side.
64   bool m_pause;		// True when pause.
65 };
66 
67 #endif	// _PlayGame_
68