-
Notifications
You must be signed in to change notification settings - Fork 0
/
Loyalist.cs
45 lines (38 loc) · 1.18 KB
/
Loyalist.cs
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
namespace Gustav
{
using Gustav.Position;
using Gustav.Storage;
using Robocode;
public class Loyalist : RateControlRobot
{
private EventRegister eventRegister;
private CombatParametersStorage combatParametersStorage;
public override void Run()
{
var resolver = new Resolver();
eventRegister = resolver.Get<EventRegister>();
combatParametersStorage = resolver.Get<CombatParametersStorage>();
resolver.Get<Runner>().Run(this);
}
public override void OnScannedRobot(ScannedRobotEvent e)
{
eventRegister.OnScan(e);
}
public override void OnBattleEnded(BattleEndedEvent evnt)
{
combatParametersStorage.CombatEnded = true;
}
public override void OnRoundEnded(RoundEndedEvent evnt)
{
combatParametersStorage.CombatEnded = true;
}
public override void OnHitRobot(HitRobotEvent evnt)
{
eventRegister.OnCollision(evnt);
}
public override void OnRobotDeath(RobotDeathEvent evnt)
{
eventRegister.OnDeath(evnt);
}
}
}