예제 #1
0
파일: Robot.cs 프로젝트: mcbodge/robowarx
        // Robot is the only ArenaObject with no OnSpawn.
        internal Robot(Arena P, double X, double Y, int number, RobotFile file)
            : base(P, X, Y)
        {
            this.number = number;
            this.file = file;

            interp = new Interpreter(new MemoryStream(file.program));

            // Load all the default registers
            StockRegisters.inject(this);

            team = 0;
            alive = true;
            deathReason = DeathReason.Suicided;
            icon = 0;

            hardware = file.hardware;
            energy = hardware.energyMax;
            damage = hardware.damageMax;
            shield = 0;
            aim = 90;
            look = 0;
            scan = 0;

            collision = false;
            wall = false;
            friend = false;
            stunned = 0;
            hit = 0;

            kills = 0;
            survival = 0;
            killTime = new int[6]{ -1, -1, -1, -1, -1, -1 };
            deathTime = -1;
            killer = null;

            // FIXME: actually implement the history
            history = new Int16[50];

            // FIXME: actually implement signals
            signals = new Int16[10];
        }
예제 #2
0
 internal VMachineException(Interpreter interp, String msg)
     : base(msg)
 {
     this.interp = interp;
 }
예제 #3
0
 public OutOfBoundsException(Interpreter interp)
     : base(interp, "Number out of bounds.")
 {
 }
예제 #4
0
 internal VMachineException(Interpreter interp, String msg, Exception innerException)
     : base(msg, innerException)
 {
     this.interp = interp;
 }