ClientParams.cpp

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 #include <client/ClientParams.h>
00022 
00023 ClientParams *ClientParams::instance_ = 0;
00024 
00025 ClientParams *ClientParams::instance()
00026 {
00027         if (!instance_)
00028         {
00029                 instance_ = new ClientParams;
00030         }
00031 
00032         return instance_;
00033 }
00034 
00035 ClientParams::ClientParams() :
00036         connect_(options_, "connect", 
00037                 "The name of the server to connect to, starts a NET/LAN client", 0, ""),
00038         client_(options_, "startclient",
00039                 "Starts a scorched 3d client, requires the name of the client settings file e.g. data/singlecustom.xml", 0, ""),
00040         startcustom_(options_, "startcustom",
00041                 "Starts a scorched 3d client, Uses the last custom game made", 0, false),
00042         save_(options_, "loadsave",
00043                 "Continues a scorched 3d client game, requires the name of the saved game.", 0, ""),
00044         exittime_(options_, "exittime",
00045                 "The time after which the client will exit", 0, 0),
00046         username_(options_, "username",
00047                 "The username of the NET/LAN server", 0, ""),
00048         password_(options_, "password",
00049                 "The password of the NET/LAN server", 0, ""),
00050         nonParam_(nonParamOptions_, "launch file", 
00051                 ".3dl scorched3d online gaming launching config", 0, "")
00052 {
00053 
00054 }
00055 
00056 ClientParams::~ClientParams()
00057 {
00058         
00059 }
00060 
00061 void ClientParams::reset()
00062 {
00063         connect_.setValueFromString(connect_.getDefaultValueAsString());
00064         client_.setValueFromString(client_.getDefaultValueAsString());
00065         startcustom_.setValueFromString(startcustom_.getDefaultValueAsString());
00066         save_.setValueFromString(save_.getDefaultValueAsString());
00067         username_.setValueFromString(username_.getDefaultValueAsString());
00068         password_.setValueFromString(password_.getDefaultValueAsString());
00069         exittime_.setValueFromString(exittime_.getDefaultValueAsString());
00070 }

Generated on Mon Feb 16 15:14:36 2009 for Scorched3D by  doxygen 1.5.3