ClientParams.h

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 #if !defined(__INCLUDE_ClientParamsh_INCLUDE__)
00022 #define __INCLUDE_ClientParamsh_INCLUDE__
00023 
00024 #include <common/OptionsParameters.h>
00025 
00026 class ClientParams : public OptionsParameters
00027 {
00028 public:
00029         static ClientParams *instance();
00030 
00031         const char *getConnect() { return connect_.getValue(); }
00032         const char *getClientFile() { return client_.getValue(); }
00033         const char *getSaveFile() { return save_.getValue(); }
00034         const char *getUserName() { return username_.getValue(); }
00035         const char *getPassword() { return password_.getValue(); }
00036         const char *getNonParam() { return nonParam_.getValue(); }
00037         int getExitTime() { return exittime_.getValue(); }
00038         bool getStartCustom() { return startcustom_.getValue(); }
00039         bool getConnectedToServer() { return (getConnect()[0] != '\0'); }
00040 
00041         void setStartCustom(bool custom) { startcustom_.setValue(custom); }
00042         void setClientFile(const char *file) { client_.setValue(file); }
00043         void setSaveFile(const char *file) { save_.setValue(file); }
00044         void setUserName(const char *username) { username_.setValue(username); }
00045         void setPassword(const char *password) { password_.setValue(password); }
00046         void setConnect(const char *address) { connect_.setValue(address); }
00047         void setExitTime(int time) { exittime_.setValue(time); }
00048 
00049         void reset();
00050 
00051 protected:
00052         static ClientParams *instance_;
00053 
00054         OptionEntryString connect_;
00055         OptionEntryString client_;
00056         OptionEntryString password_;
00057         OptionEntryString username_;
00058         OptionEntryString save_;
00059         OptionEntryString nonParam_;
00060         OptionEntryBool startcustom_;
00061         OptionEntryInt exittime_;
00062 
00063 private:
00064         ClientParams();
00065         virtual ~ClientParams();
00066 
00067 };
00068 
00069 #endif // __INCLUDE_ClientParamsh_INCLUDE__

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