public void OnStatus(StatusEvent evnt)
        {
            count(evnt);
            IGraphics g = peer.GetGraphics();

            g.DrawEllipse(Pens.Orange, (int) (peer.GetX() - 55), (int) (peer.GetY() - 55), 110, 110);
        }
Beispiel #2
0
 public override void OnStatus(StatusEvent evnt)
 {
     dump();
 }
Beispiel #3
0
 /// <inheritdoc />
 public virtual void OnStatus(StatusEvent e)
 {
 }
Beispiel #4
0
            public void OnStatus(StatusEvent e)
            {
                RobotStatus s = e.Status;

                robot.others = robot.peer.GetOthers();
                robot.energy = Math.Max(1, (int) (s.Energy + 0.5));
                robot.robotX = (int) (s.X + 0.5);
                robot.robotY = (int) (s.Y + 0.5);
                robot.heading = (int) (Utils.ToDegrees(s.Heading) + 0.5);
                robot.gunHeading = (int) (Utils.ToDegrees(s.GunHeading) + 0.5);
                robot.gunBearing =
                    (int) (Utils.ToDegrees(Utils.NormalRelativeAngle(s.GunHeading - s.Heading)) + 0.5);
                robot.gunReady = (s.GunHeat <= 0);

                currentTurn = e.Time;

                // Auto Fire
                if (juniorFirePower > 0 && robot.gunReady && (robot.peer.GetGunTurnRemaining() == 0))
                {
                    if (robot.peer.SetFire(juniorFirePower) != null)
                    {
                        robot.gunReady = false;
                        juniorFirePower = 0;
                    }
                }

                // Reset event data
                robot.scannedDistance = -1;
                robot.scannedAngle = -1;
                robot.scannedBearing = -1;
                robot.scannedVelocity = -99;
                robot.scannedHeading = -1;
                robot.scannedEnergy = -1;
                robot.hitByBulletAngle = -1;
                robot.hitByBulletBearing = -1;
                robot.hitRobotAngle = -1;
                robot.hitRobotBearing = -1;
                robot.hitWallAngle = -1;
                robot.hitWallBearing = -1;
            }
Beispiel #5
0
 public override void OnStatus(StatusEvent e)
 {
     Out.WriteLine("live");
     slowResponse();
 }
        internal override void initializeRound(ExecCommands commands, RobotStatus status)
        {
            updateStatus(commands, status);
            eventManager.reset();
            var start = new StatusEvent(status);

            eventManager.add(start);
            setSetCallCount(0);
            setGetCallCount(0);
        }
Beispiel #7
0
 public override void OnStatus(StatusEvent e)
 {
     _robotStatus = e.Status;
 }