#ifndef CINSTRUCTION_H #define CINSTRUCTION_H #include enum Command : uint16_t { CREATE, MOVE, DIE, TRANS, RTRANS, TURN, JUMP, AJUMP, BJUMP, SCAN, FARSCAN, SET, ADD, SUB, MUL, DIV, MOD, MIN, MAX, RANDOM, IF, IFN, IFG, IFL, IFGE, IFLE, INIT, BREAK, RESUME, SEIZE, SLEEP, QUIT, }; enum Params : uint16_t { LLL, LLV, LVL, LVV, VLL, VLV, VVL, VVV, N = LLL, L = LLL, V = VLL, LL = LLL, LV = LVL, VL = VLL, VV = VVV, }; enum Variables { Local_0, Local_1, Local_2, Local_3, Local_4, Local_5, Local_6, Local_7, Local_8, Local_9, Local_10, Local_11, Local_12, Local_13, Local_14, Local_15, Local_16, Local_17, Local_18, Local_19, LocalActive, LocalBanks, LocalInstrSet, LocalMobile, LocalAge, LocalTasks, LocalGeneration, LocalId, RemoteActive, RemoteBanks, RemoteInstrSet, RemoteMobile, RemoteAge, RemoteTasks, RemoteGeneration, GlobalPub, GlobalTeam, GlobalOwn, GlobalOthers, GlobalFields, GlobalTime, GlobalTimeout, }; enum Error { NoError, // No error EliminationTrigger, // Elimination Trigger released DataHunger, // Data Hunger (Bank 1 empty and executed) DivisionByZero, // Division by zero InvalidBankNumber, // Invalid bank number (e.g. in TRANS or BJUMP) HigherInstructionSetRequired, // Higher Instruction Set required MobilityRequired, // Mobility required DieExecuted, // DIE executed InvalidParameter , // Invalid parameter (e.g. CREATE x, -1, x) Unemployment, // No more tasks left in a robot (Unemployment) InstructionDurationTooHigh, // Instruction duration too high (i.e. > MaxInstrDur) }; using Parameter = int32_t; struct Instruction { Command command = DIE; Params params = N; Parameter a = 0; Parameter b = 0; Parameter c = 0; Instruction(Command _command, Params _params = N, Parameter _a = 0, Parameter _b = 0, Parameter _c = 0); }; #endif // CINSTRUCTION_H