private PlanetFacility InitializeFacility(FacilityItem facilityItem) { return new PlanetFacility { FacilityId = (int)facilityItem, IsUpdating = false, PlanetId = _planetId, Level = 0, UpdateStart = DateTime.Now }; }
private FacilityCategory GetShipHull(FacilityItem ship) { return Enums<FacilityCategory>.Parse(ship.gameObject.name); }
private void UponOrderOutcome(FacilityDirective directive, FacilityItem facility, bool isSuccess, IElementAttackable target, UnitItemOrderFailureCause failCause) { RelayToCurrentState(directive, facility, isSuccess, target, failCause); }
/// <summary> /// Handles the results of the facility's attempt to execute the provided directive. /// </summary> /// <param name="directive">The directive.</param> /// <param name="facility">The facility.</param> /// <param name="isSuccess">if set to <c>true</c> the directive was successfully completed. May still be ongoing.</param> /// <param name="target">The target. Can be null.</param> /// <param name="failCause">The failure cause if not successful.</param> internal void HandleOrderOutcome(FacilityDirective directive, FacilityItem facility, bool isSuccess, IElementAttackable target = null, UnitItemOrderFailureCause failCause = UnitItemOrderFailureCause.None) { UponOrderOutcome(directive, facility, isSuccess, target, failCause); }
protected void ExecuteAttackOrder_UponOrderOutcome(FacilityDirective directive, FacilityItem facility, bool isSuccess, IElementAttackable target, UnitItemOrderFailureCause failCause) { LogEvent(); if (directive != FacilityDirective.Attack) { D.Warn("{0} State {1} erroneously received OrderOutcome callback with {2} {3}.", DebugName, CurrentState.GetValueName(), typeof(FacilityDirective).Name, directive.GetValueName()); return; } // TODO What? It will be common for an attack by a facility to fail for cause unreachable as its target moves out of range... }
private void OnFleetElementDestroyed(FacilityItem ship) { if (ship.gameObject.GetSafeInterface<ICameraFocusable>().IsFocus) { // our fleet's ship that was just destroyed was the focus, so change the focus to the fleet (View as ICameraFocusable).IsFocus = true; } }
public FacilityCtxControl_AI(FacilityItem facility) : base(facility.gameObject, uniqueSubmenusReqd: Constants.Zero, menuPosition: MenuPositionMode.Offset) { _facilityMenuOperator = facility; }