-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathMyStrategy.cs
32 lines (29 loc) · 1.03 KB
/
MyStrategy.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
using AiCup22.Model;
using System.Collections.Generic;
namespace AiCup22
{
public class MyStrategy
{
public MyStrategy(AiCup22.Model.Constants constants) {}
public AiCup22.Model.Order GetOrder(AiCup22.Model.Game game, DebugInterface debugInterface)
{
Order order = new Order();
IDictionary<int, UnitOrder> orders = new Dictionary<int, UnitOrder>();
ActionOrder aim = new ActionOrder.Aim(true);
foreach(Unit unit in game.Units)
{
if (unit.PlayerId != game.MyId)
{
continue;
}
orders.Add(unit.Id, new UnitOrder(
new Vec2(-unit.Position.X, -unit.Position.Y),
new Vec2(-unit.Position.Y, unit.Position.X),
new ActionOrder.Aim(true)));
}
return new Order(orders);
}
public void DebugUpdate(int displayedTick, DebugInterface debugInterface) {}
public void Finish() {}
}
}