diff options
Diffstat (limited to 'patrol_order.go')
| -rw-r--r-- | patrol_order.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/patrol_order.go b/patrol_order.go index b7201ed..eb9dfb0 100644 --- a/patrol_order.go +++ b/patrol_order.go @@ -1,10 +1,14 @@ package main -import "golang.org/x/exp/slog" +import ( + "age_of_empires/physics" + + "golang.org/x/exp/slog" +) type PatrolOrder struct { - origin Point - destination Point + origin physics.Point + destination physics.Point } func (o *PatrolOrder) Update(e *Entity, g *Game) { @@ -12,15 +16,15 @@ func (o *PatrolOrder) Update(e *Entity, g *Game) { if !e.Move.Value.IsActive { moveMap := g.getMoveMap() if e.Position.Value == o.destination { - e.StartMove(o.origin, moveMap) + physics.StartMove(&e.Move, e.Position, o.origin, moveMap) } else { - e.StartMove(o.destination, moveMap) + physics.StartMove(&e.Move, e.Position, o.destination, moveMap) } } } } -func Patrol(e *Entity, destination Point) Order { +func Patrol(e *Entity, destination physics.Point) Order { if e.Selection.IsEnabled && e.Position.IsEnabled && e.Move.IsEnabled && e.Order.IsEnabled { if e.Selection.Value.IsSelected { origin := e.Position.Value |
