feat: goap ai for faction and ship
This commit is contained in:
@@ -152,7 +152,9 @@ public sealed partial class SimulationEngine
|
||||
ship.State,
|
||||
ship.OrderKind,
|
||||
ship.DefaultBehaviorKind,
|
||||
ship.BehaviorPhase,
|
||||
ship.ControllerTaskKind,
|
||||
ship.CommanderObjective,
|
||||
ship.NodeId,
|
||||
ship.BubbleId,
|
||||
ship.DockedStationId,
|
||||
@@ -474,6 +476,7 @@ public sealed partial class SimulationEngine
|
||||
ship.State.ToContractValue(),
|
||||
ship.Order?.Kind ?? "none",
|
||||
ship.DefaultBehavior.Kind,
|
||||
ship.DefaultBehavior.Phase ?? "none",
|
||||
ship.ControllerTask.Kind.ToContractValue(),
|
||||
ship.SpatialState.CurrentNodeId ?? "none",
|
||||
ship.SpatialState.CurrentBubbleId ?? "none",
|
||||
@@ -660,7 +663,12 @@ public sealed partial class SimulationEngine
|
||||
policy.ConstructionAccessPolicy,
|
||||
policy.OperationalRangePolicy);
|
||||
|
||||
private ShipDelta ToShipDelta(SimulationWorld world, ShipRuntime ship) => new(
|
||||
private ShipDelta ToShipDelta(SimulationWorld world, ShipRuntime ship)
|
||||
{
|
||||
var commander = ship.CommanderId is null ? null
|
||||
: world.Commanders.FirstOrDefault(c => c.Id == ship.CommanderId && c.Kind == CommanderKind.Ship);
|
||||
|
||||
return new ShipDelta(
|
||||
ship.Id,
|
||||
ship.Definition.Label,
|
||||
ship.Definition.Kind,
|
||||
@@ -672,7 +680,9 @@ public sealed partial class SimulationEngine
|
||||
ship.State.ToContractValue(),
|
||||
ship.Order?.Kind,
|
||||
ship.DefaultBehavior.Kind,
|
||||
ship.DefaultBehavior.Phase,
|
||||
ship.ControllerTask.Kind.ToContractValue(),
|
||||
commander?.ActiveActionName,
|
||||
ship.SpatialState.CurrentNodeId,
|
||||
ship.SpatialState.CurrentBubbleId,
|
||||
ship.DockedStationId,
|
||||
@@ -688,6 +698,7 @@ public sealed partial class SimulationEngine
|
||||
ship.History.ToList(),
|
||||
ToShipActionProgressSnapshot(world, ship),
|
||||
ToShipSpatialStateSnapshot(ship.SpatialState));
|
||||
}
|
||||
|
||||
private static ShipActionProgressSnapshot? ToShipActionProgressSnapshot(SimulationWorld world, ShipRuntime ship)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user