Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

robglob.h

Go to the documentation of this file.
00001 /*
00002  * robglob.h
00003  * 
00004  * Copyright (c) 2000-2004 by Florian Fischer (florianfischer@gmx.de)
00005  * and Martin Trautmann (martintrautmann@gmx.de) 
00006  * 
00007  * This file may be distributed and/or modified under the terms of the 
00008  * GNU General Public License version 2 as published by the Free Software 
00009  * Foundation. 
00010  * 
00011  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013  * 
00014  */
00015 
00020 #ifndef __RT_GLOBALS__
00021 #define __RT_GLOBALS__
00022 
00023 #include <rtsystem.h>
00024 #include <rtmath.h>
00025 #include <rtini.h>
00026 
00027 //using namespace lrt;
00028 
00029 // You must not include anything else from RoboTour in this file.
00030 #include "robvars.h"
00031 
00032 
00033 namespace rt {
00034 // fwd declaration
00035 class ErrorHandler;
00036 
00038 class Globals{
00039 public:
00040         rint fields;
00041         rint fieldsX;
00042         rint fieldsY;
00043         rint enableElim;
00044         rint elim;
00045         unsigned long timeout;
00046         rint maxCreateDur;
00047         rint maxSleepDur;
00048         rint maxInstrDur;
00049         rint maxGeneration;
00050         rint enableRC3Instr;
00051         rint enableMultitasking;
00052         rint enableFAT;
00053         rint enableLifetime;
00054         rint enableNutcracker; 
00055         rint firstRobotMobile;
00056         rint minId;
00057         rint maxId;
00058 
00059         rint maxInstr;
00060         rint maxBanks;
00061         rint maxVars;
00062         rint maxTasks;//
00063         rint maxMybots;//
00064         unsigned long maxLifetime;//
00065 
00066         rint durDie;
00067         rint durMove;
00068         rint durTurn;
00069         rint durAjump;//
00070         rint durJump;
00071         rint durBjump;
00072         rint durScan;
00073         rint durFarscan;//
00074         rint durFarscanPerField;//
00075         rint durSet;
00076         rint durAdd;
00077         rint durSub;
00078         rint durMul;//
00079         rint durDiv;//
00080         rint durMod;//
00081         rint durMin;//
00082         rint durMax;//
00083         rint durTrans;
00084         rint durTransPerInstr;
00085         rint durRtrans;//
00086         rint durRtransPerInstr;//
00087         rint durComp;
00088         rint durNcomp;//
00089         rint durGcomp;//
00090         rint durLcomp;//
00091         rint durRandom;//
00092         rint durCreate;
00093         rint durCreatePerBank;
00094         rint durCreateMulMobile;
00095         rint durCreateAddMobile;//
00096         rint durCreateAdvISet;
00097         rint durCreateSuperISet;
00098 
00099         rint durBreak;//
00100         rint durInit;//
00101         rint durSeize;//
00102         rint durResume;//
00103         rint durQuit;//
00104 
00105         rint durRemote;
00106 
00113         bool getGlobals(const lrt::String& filename);
00114 
00116         Globals(const ErrorHandler* errHandler) : errHandler(errHandler) {}
00117         ~Globals() {}
00118 
00119 private:
00120         const ErrorHandler* errHandler;
00121 
00122         // Fetches a rint from an ini file section
00123         rint getRint( lrt::IniSection& sec, const char* name, rint def = -1, rint min = MIN_RINT, rint max = MAX_RINT);
00124 
00125         // Fetches an int from an ini file section
00126         int getInt( lrt::IniSection& sec, const char* name, int def = -1, int min = lrt::Math::MIN_INT, int max = lrt::Math::MAX_INT);
00127 };
00128 
00129 
00130 
00131 } // namespace
00132 
00133 #endif
00134 

This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer