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 #include "gamestate.h" 00018 00019 GAMESTATE::GAMESTATE() 00020 { 00021 state = STATE_INIT; 00022 } 00023 00024 void GAMESTATE::UpdateSettings() 00025 { 00026 int m; 00027 settings.Get( "game.game_mode", m ); 00028 mode = (MODES)m; 00029 } 00030 00031 STATES GAMESTATE::GetGameState() 00032 { 00033 return state; 00034 } 00035 00036 void GAMESTATE::SetGameState(STATES newstate) 00037 { 00038 state = newstate; 00039 } 00040 00041 void GAMESTATE::SetCarName(int p, string cn) 00042 { 00043 players[p].carname = cn; 00044 //cout << p << "," << cn << endl; 00045 if (p == 0) 00046 settings.Set("game.selected_car",cn); 00047 } 00048 00049 void GAMESTATE::SetCarPaint(int p, int cp) 00050 { 00051 players[p].carpaint = cp; 00052 if (p == 0) 00053 settings.Set("game.car_paint",cp); 00054 }
1.4.6