include/gamestate.h

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or modify
00003  *  it under the terms of the GNU General Public License as published by
00004  *  the Free Software Foundation; either version 2 of the License, or
00005  *  (at your option) any later version.
00006  *
00007  *  This program is distributed in the hope that it will be useful,
00008  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00009  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010  *  GNU Library General Public License for more details.
00011  *
00012  *  You should have received a copy of the GNU General Public License
00013  *  along with this program; if not, write to the Free Software
00014  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00015  */
00016  
00017 #ifndef _GAMESTATE_H
00018 
00019 #include <iostream>
00020 #include "settings.h"
00021 #include "globals.h"
00022 
00023 using namespace std;
00024 
00025 #define MAX_PLAYERS 2
00026 
00027 enum STATES
00028 {
00029         STATE_INIT=0,
00030         STATE_LOGO=1,
00031         STATE_INITIALMENU=2,
00032         STATE_PLAYING=3,
00033         STATE_STAGING=4,
00034         
00035         STATE_EXIT=100
00036 };
00037 
00038 enum MODES
00039 {
00040         MODE_FREEDRIVE=0,
00041         MODE_TIMETRIAL=1,
00042         MODE_NETMULTIFREE=2
00043 };
00044 
00045 class PLAYERINFO
00046 {
00047 public:         
00048         string carname;
00049         int carpaint;
00050 };
00051 
00052 class GAMESTATE
00053 {
00054 private:
00055         STATES state;
00056         MODES mode;
00057         PLAYERINFO players[MAX_PLAYERS];
00058         string trackname;
00059 /*
00060         string treedetail;
00061         string terraindetail;
00062 */      
00063 public:
00064         GAMESTATE();
00065         void UpdateSettings();
00066         STATES GetGameState();
00067         void SetGameState(STATES newstate);
00068         void SetGameMode(MODES newmode) {mode = newmode; settings.Set( "game.mode", newmode ); }
00069         MODES GetGameMode() {return mode;}
00070         
00071         void SetCarName(int p, string cn);
00072         void SetCarPaint(int p, int cp);
00073         void SetTrackName(string tn) {trackname = tn; settings.Set( "game.track", tn); }
00074         
00075         string GetTrackName() {return trackname;}
00076         string GetCarName(int p) {return players[p].carname;}
00077         int GetCarPaint(int p) {return players[p].carpaint;}
00078 };
00079 
00080 #define _GAMESTATE_H
00081 #endif /* _GAMESTATE_H */

Generated on Thu Oct 19 04:05:47 2006 by  doxygen 1.4.6