#pragma once #include #include #include #include #include #include "params.h" using namespace std; struct Location{ int bank; // 0-based int pos; // 0-based }; enum class arg_t{ number, var, name, constant, undeflabel, }; struct Argument{ arg_t type; bool remote; int num; string name; ~Argument(); }; struct Instruction{ ins_t op; vector args; static Instruction make(ins_t op,vector args); }; using Script = vector; class Team; class World; enum class WorldAction{ none, die, move, }; class Robot{ Location ip={0,0}; int waited=0; array vars; uint16_t* resolveVar(const Argument &arg,World &world); Instruction resolve(World &world); int calcDuration(Instruction &ins); WorldAction execute(Instruction &ins,World &world); void advanceIP(); bool ipInRange() const; public: const Team *team; vector