void ExecuteAssumeCloseOrbitOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); // TODO }
private void UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { RelayToCurrentState(fsmTgt); }
void ExecuteExploreOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); // TODO }
/// <summary> /// Initializes a new instance of the <see cref="AItemReport" /> class. /// </summary> /// <param name="player">The player requesting the report.</param> /// <param name="item">The item the report is about.</param> public AItemReport(AItemData data, Player player, IItem_Ltd item) { Player = player; Item = item; __PositionForCameraDistance = new Reference<Vector3>(() => item.Position); AssignValues(data); }
void ExecutePatrolOrder_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); //D.Log(ShowDebugLog, "{0} received a FsmTgtInfoAccessChgd event while executing a patrol order.", DebugName); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IPatrollable patrollableTgt = _fsmTgt as IPatrollable; if (!patrollableTgt.IsPatrollingAllowedBy(Owner)) { D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as Relations with newly accessed Owner {3} is {4}.", DebugName, CurrentOrder.Directive.GetValueName(), patrollableTgt.DebugName, patrollableTgt.Owner_Debug, Owner.GetCurrentRelations(patrollableTgt.Owner_Debug).GetValueName()); // TODO Communicate failure to boss? StationaryLocation assumeFormationTgt = GameUtility.GetClosest(Position, patrollableTgt.LocalAssemblyStations); CurrentOrder = new FleetOrder(FleetDirective.AssumeFormation, OrderSource.CmdStaff, assumeFormationTgt); } }
void Attacking_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); // TODO }
void ExecuteAttackOrder_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); // TODO }
void ExecuteJoinFleetOrder_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); if (fsmTgt.IsOwnerAccessibleTo(Owner)) { Player tgtFleetOwner; bool isAccessible = fsmTgt.TryGetOwner(Owner, out tgtFleetOwner); D.Assert(isAccessible); if (tgtFleetOwner == Owner) { // target fleet owner is still us return; } } // owner is no longer us IssueAssumeFormationOrderFromCmdStaff(); }
void ExecuteJoinFleetOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); // owner is no longer us IssueAssumeFormationOrderFromCmdStaff(); }
void ExecuteAttackOrder_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IUnitAttackable attackedTgt = _fsmTgt as IUnitAttackable; if (!attackedTgt.IsAttackByAllowed(Owner)) { D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as just lost access to Owner {3}.", DebugName, CurrentOrder.Directive.GetValueName(), attackedTgt.DebugName, attackedTgt.Owner_Debug); // TODO Communicate failure to boss? IssueAssumeFormationOrderFromCmdStaff(); } }
void ExecuteAttackOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IUnitAttackable attackedTgt = _fsmTgt as IUnitAttackable; if (attackedTgt.IsWarAttackByAllowed(Owner)) { // With an owner change, the attack should continue only if at War with new owner return; } D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as Relations with new Owner {3} is {4}.", DebugName, CurrentOrder.Directive.GetValueName(), attackedTgt.DebugName, attackedTgt.Owner_Debug, Owner.GetCurrentRelations(attackedTgt.Owner_Debug).GetValueName()); // TODO Communicate failure to boss? IssueAssumeFormationOrderFromCmdStaff(); }
void Guarding_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IGuardable guardedTgt = _fsmTgt as IGuardable; if (!guardedTgt.IsGuardingAllowedBy(Owner)) { D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as Relations with new Owner {3} is {4}.", DebugName, CurrentOrder.Directive.GetValueName(), guardedTgt.DebugName, guardedTgt.Owner_Debug, Owner.GetCurrentRelations(guardedTgt.Owner_Debug).GetValueName()); _orderFailureCause = UnitItemOrderFailureCause.TgtRelationship; Return(); } }
void ExecuteGuardOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IGuardable guardableTgt = _fsmTgt as IGuardable; if (!guardableTgt.IsGuardingAllowedBy(Owner)) { D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as Relations with new Owner {3} is {4}.", DebugName, CurrentOrder.Directive.GetValueName(), guardableTgt.DebugName, guardableTgt.Owner_Debug, Owner.GetCurrentRelations(guardableTgt.Owner_Debug).GetValueName()); // TODO Communicate failure to boss? StationaryLocation assumeFormationTgt = GameUtility.GetClosest(Position, guardableTgt.LocalAssemblyStations); CurrentOrder = new FleetOrder(FleetDirective.AssumeFormation, OrderSource.CmdStaff, assumeFormationTgt); } }
void Patrolling_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IPatrollable patrolledTgt = _fsmTgt as IPatrollable; if (!patrolledTgt.IsPatrollingAllowedBy(Owner)) { D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as Relations with newly accessed Owner {3} is {4}.", DebugName, CurrentOrder.Directive.GetValueName(), patrolledTgt.DebugName, patrolledTgt.Owner_Debug, Owner.GetCurrentRelations(patrolledTgt.Owner_Debug).GetValueName()); _orderFailureCause = UnitItemOrderFailureCause.TgtRelationship; Return(); } }
void AssumingCloseOrbit_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IShipNavigable); if (LastState == ShipState.ExecuteExploreOrder) { // Note: FleetCmd handles not being allowed to explore var exploreTgt = _fsmTgt as IShipExplorable; if (exploreTgt.IsFullyExploredBy(Owner)) { Return(); } } }
void Moving_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); if (fsmTgt.IsOwnerAccessibleTo(Owner)) { // evaluate reassessing move as target's owner is accessible to us UnitItemOrderFailureCause failCause; if (ShouldMovingBeReassessed(out failCause, __isFsmInfoAccessChgd: false)) { _orderFailureCause = failCause; Return(); } } }
void Attacking_UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { LogEvent(); // TODO }
private void HandleFsmTgtInfoAccessChgd(Player playerWhoseInfoAccessChgd, IItem_Ltd fsmTgt) { if (playerWhoseInfoAccessChgd == Owner) { UponFsmTgtInfoAccessChgd(fsmTgt); } }
void Moving_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IShipNavigable); if (LastState == ShipState.ExecuteExploreOrder) { // Note: FleetCmd handles not being allowed to explore var exploreTgt = _fsmTgt as IShipExplorable; if (exploreTgt.IsFullyExploredBy(Owner)) { // not a failure so no failure code Return(); } } }
private void HandleFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { UponFsmTgtOwnerChgd(fsmTgt); }
void ExecuteAttackOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); // TODO }
private void UponFsmTgtInfoAccessChgd(IItem_Ltd fsmTgt) { RelayToCurrentState(fsmTgt); }
/// <summary> /// Indicates whether the Owner has knowledge of the provided item. /// </summary> /// <param name="item">The item.</param> /// <returns></returns> public bool HasKnowledgeOf(IItem_Ltd item) { Utility.ValidateNotNull(item); if (item is IPlanetoid_Ltd) { return _planetoids.Contains(item as IPlanetoid_Ltd); } if (item is IUnitElement_Ltd) { return _elements.Contains(item as IUnitElement_Ltd); } if (item is IUnitCmd_Ltd) { return _commands.Contains(item as IUnitCmd_Ltd); } if (item is IUniverseCenter_Ltd) { D.AssertEqual(UniverseCenter, item); D.Warn("{0}: unnecessary check for knowledge of {1}.", DebugName, item.DebugName); return true; } if (item is IStar_Ltd) { D.Assert(_stars.Contains(item as IStar_Ltd)); D.Warn("{0}: unnecessary check for knowledge of {1}.", DebugName, item.DebugName); return true; } if (item is ISystem_Ltd) { D.Assert(_systemLookupBySectorID.Values.Contains(item as ISystem_Ltd)); D.Warn("{0}: unnecessary check for knowledge of {1}.", DebugName, item.DebugName); return true; } return false; }
void ExecuteExploreOrder_UponFsmTgtOwnerChgd(IItem_Ltd fsmTgt) { LogEvent(); D.AssertEqual(_fsmTgt, fsmTgt as IFleetNavigable); IFleetExplorable fleetExploreTgt = _fsmTgt as IFleetExplorable; if (!fleetExploreTgt.IsExploringAllowedBy(Owner) || fleetExploreTgt.IsFullyExploredBy(Owner)) { // new known owner is either at war with us or an ally Player fsmTgtOwner; bool isFsmTgtOwnerKnown = fleetExploreTgt.TryGetOwner(Owner, out fsmTgtOwner); D.Assert(isFsmTgtOwnerKnown); D.Log(ShowDebugLog, "{0} {1} order for {2} is no longer valid as Relations with new Owner {3} is {4}.", DebugName, CurrentOrder.Directive.GetValueName(), fleetExploreTgt.DebugName, fsmTgtOwner, Owner.GetCurrentRelations(fsmTgtOwner).GetValueName()); // TODO Communicate failure/success to boss? var closestLocalAssyStation = GameUtility.GetClosest(Position, fleetExploreTgt.LocalAssemblyStations); CurrentOrder = new FleetOrder(FleetDirective.AssumeFormation, OrderSource.CmdStaff, closestLocalAssyStation); } }