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

robvars.h

Go to the documentation of this file.
00001 /*
00002  * robvars.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 
00021 // In this file, you must not include anything!
00022 
00023 #ifndef __RT_ROBVARS__
00024 #define __RT_ROBVARS__
00025 
00026 namespace rt {
00027 
00029 extern const char* version; 
00030 extern const char* userVersion; 
00031 extern const char* aboutText; 
00032 extern const int languageVersion;
00033 
00035 typedef short rint;
00036 
00037 const rint MAX_RINT = 32767;
00038 const rint MIN_RINT = -32768;
00039 
00041 enum VerboseMode {
00042         verbRemote = -999,      
00043         verbNone = 0,           
00044         verbSome = 2,           
00045         verbNormal = 5          
00046 };
00047 
00048 
00050 
00052 enum SimVar {
00053         simFields = 0,          
00054         simPub,                         
00055         simTime,                        
00056         simMaxGeneration,       
00057         simMaxVars,                     
00058         simMaxTasks,            
00059         simMaxMybots,           
00060         simTimeout,                     
00061         simElimTrigger,         
00062         simMaxLifetime,         
00063         simVarLength            
00064 };
00065 
00068 enum HeaderType {
00069         headerInternal,
00070         headerSecret,
00071         headerPublished
00072 };
00073 
00075 enum ProgramVar {
00076         progMybots = 0,         
00077         progOtherbots,          
00078         progId,                         
00079         progVarLength           
00080 };
00081 
00084 enum BotVar {
00085         botActive = 0,          
00086         botNumBanks,            
00087         botGeneration,          
00088         botPosX,                        
00089         botPosY,                        
00090         botInstrSet,            
00091         botMobile,                      
00092         botNumTasks,            
00093         botVarLength            
00094 };
00095 
00098 enum TimingMode {
00099         timingNumExec = 0,      
00100         timingNumWaited = 1     
00101 };
00102 
00104 enum TaskVar {
00105         taskCurBank = 0,        
00106         taskCurInstr,           
00107         taskDir,                        
00108         taskNumCycles,          
00109         taskCyclesDone,         
00110 // value is larger than a rint
00111 //      taskInstrStarted,       ///< game time when the instruction was started
00112         taskTimingMode,         
00113         taskVarLength           
00114 };
00115 
00116 
00119 enum Direction {
00120         dirRight = 0,
00121         dirUp = 1,
00122         dirLeft = 2,
00123         dirDown = 3
00124 };
00125 
00127 enum TurnType {
00128         turnLeft = 1,
00129         turnRight = 3
00130 };
00131 
00133 enum OpType {
00134         opTypeNumber,     
00135         opTypeTask,               
00136         opTypeActive,     
00137         opTypeNamedVar,   
00138         opTypeUnnamedVar, 
00139         opTypeArray,      
00140         opTypeProgram,    
00141         opTypeGlobal,     
00142         opTypeFields,     
00143         opTypeAge,                
00144         opTypeLabel,      
00145         opTypeAbsLabel,   
00146         opTypeRandom = 99 
00147 };
00148 
00150 enum ExecReturnType {
00151 
00152         execSleeps = 1,         
00153 
00154         execOK = 0,                     
00155 
00156         // For all failures: kill the bot
00157         // Need continuous fail codes! (see robstrings.h: failMsg[])
00158         failElim = -1,          
00159         failData = -2,          
00160         failDiv0 = -3,          
00161         failBank = -4,          
00162         failInstrSet = -5,      
00163         failMobile = -6,        
00164         failDie = -7,           
00165         failParam = -8,         
00166         failUnemploy = -9,      
00167         failInstrDur = -10,     
00168         failAge = -11,          
00169         failQuit = -12,         
00170         failLast = failQuit
00171 };
00172 
00175 enum SimSuperPosition {
00176         supPosFront = -100,             
00177         supPosDontCare = 0,             
00178         supPosBack = 100,               
00179         supPosBotCreator = 999, 
00180         supPosBotPresenter = 1000 
00181 };
00182 
00183 
00185 enum GameEventType {
00186         gameAbort = -1,         
00187         gameNothing = 0,        
00188         gameTie,                        
00189         gameFinished            
00190 };
00191 
00194 enum RobLoadConstants {
00195         rlMaxRecurse = 10               
00196 };
00197 
00199 enum RobLoadReturnType {
00200         rlOK = 0,                                       
00201         rlFailNoBanks = 1,                      
00202         rlFailUnknownCommand = 2,       
00203         rlFailUnknownParam = 3,         
00204         rlFailWrongParCount = 4,        
00205         rlFailExpectComma = 5,          
00206         rlFailExpectBank = 6,           
00207         rlFailUndefinedLabel = 7,       
00208         rlFailRedefinedLabel = 8,       
00209         rlFailNoFile = 9,                       
00210         rlFailNoMemory = 10,            
00211         rlFailRC3Required = 11,         
00212         rlFailMuTaRequired = 12,        
00213         rlFailTooManyBanks = 13,        
00214         rlFailTooManyInstrs = 14,       
00215         rlFailDefines = 15,                     
00216         rlFailWrongDefinePar = 16,      
00217         rlFailTooManyDefinePar = 17, 
00218         rlFailExpectAnd = 18,           
00219         rlFailExpectBOpen = 19,         
00220         rlFailExpectBClose = 20,        
00221         rlFailExpectOpen = 21,          
00222         rlFailExpectClose = 22,         
00223         rlFailExpectQuestionMark = 23, 
00224         rlFailRecurse = 24,                     
00225         rlFailUndefinedDefine = 25,     
00226         rlFailRedefinedDefine = 26,     
00227         rlFailInvalidIdentifier = 27 
00228 };
00229 
00232 enum RbiLoadReturnType {
00233         rbOK = 0,                                       
00234         rbFailNoBanks = 1,                      
00235         rbFailUnknownCommand = 2,       
00236         rbFailUnknownParam = 3,         
00237         rbFailWrongParCount = 4,        
00238         rbFailNoFile = 5,                       
00239         rbFailNoMemory = 6,                     
00240         rbFailRC3Required = 7,          
00241         rbFailMuTaRequired = 8,         
00242         rbFailTooManyBanks = 9,         
00243         rbFailTooManyInstrs = 10,       
00244         rbFailEndOfFile = 11,           
00245         rbFailUndefined = 12            
00246 };
00247 
00249 enum GenLoadFailType {
00250         genFailLanguageVersion = 0      
00251 };
00252 
00253 
00254 } // namespace
00255 
00256 #endif

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