summaryrefslogtreecommitdiff
path: root/src/core/RoboMom.cs
blob: 50d577e938c224c692b702de9727c5331fc87f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using Robocode;

namespace core
{
    public class RoboMom : Robot
    {
        readonly IPublishEvents publisher;

        public RoboMom(IPublishEvents publisher)
        {
            this.publisher = publisher;
        }

        public override void Run()
        {
            while(true)
            {
                TurnLeft(10);
                Ahead(5);
            }
        }

        public override void OnBulletHit(BulletHitEvent evnt)
        {
            publisher.Publish(evnt);
        }

        public override void OnBulletHitBullet(BulletHitBulletEvent evnt)
        {
            base.OnBulletHitBullet(evnt);
        }

        public override void OnBulletMissed(BulletMissedEvent evnt)
        {
            base.OnBulletMissed(evnt);
        }

        public override void OnDeath(DeathEvent evnt)
        {
            base.OnDeath(evnt);
        }

        public override void OnHitByBullet(HitByBulletEvent evnt)
        {
            base.OnHitByBullet(evnt);
        }

        public override void OnHitRobot(HitRobotEvent evnt)
        {
            base.OnHitRobot(evnt);
        }

        public override void OnHitWall(HitWallEvent evnt)
        {
            base.OnHitWall(evnt);
            TurnRight(180);
        }

        public override void OnRobotDeath(RobotDeathEvent evnt)
        {
            base.OnRobotDeath(evnt);
        }

        public override void OnScannedRobot(ScannedRobotEvent evnt)
        {
            base.OnScannedRobot(evnt);
            TurnGunLeft(Heading - evnt.Bearing);
            Fire(10);
        }

        public override void OnWin(WinEvent evnt)
        {
            base.OnWin(evnt);
        }

        public override void OnRoundEnded(RoundEndedEvent evnt)
        {
            base.OnRoundEnded(evnt);
        }

        public override void OnBattleEnded(BattleEndedEvent evnt)
        {
            base.OnBattleEnded(evnt);
        }

        public override bool IsAdjustGunForRobotTurn
        {
            get { return base.IsAdjustGunForRobotTurn; }
            set { base.IsAdjustGunForRobotTurn = value; }
        }
    }
}