コード例 #1
0
        private BehaviorExecutionResults DropOffCargoToStationCorporateHangars()
        {
            var methodName = "DropoffAtStationCorpHangarArray";

            LogTrace(methodName);

            switch (_stationDropOffState)
            {
            case StationDropOffStates.Idle:
                _stationDropOffState = StationDropOffStates.InitializeStationCorporateHangars;
                goto case StationDropOffStates.InitializeStationCorporateHangars;

            case StationDropOffStates.InitializeStationCorporateHangars:
                LogMessage(methodName, LogSeverityTypes.Debug, "Initializing station corporate hangars for item transfer.");
                _station.InitializeStationCorpHangars();

                _stationDropOffState = StationDropOffStates.UnloadCargoHold;
                break;

            case StationDropOffStates.UnloadCargoHold:
                if (_doDropoffRandomWait.ShouldWait())
                {
                    return(BehaviorExecutionResults.Incomplete);
                }

                if (!_ship.IsCargoHoldActive)
                {
                    LogMessage(methodName, LogSeverityTypes.Debug, "Making my ship's cargo hold active.");
                    _ship.MakeCargoHoldActive();
                    return(BehaviorExecutionResults.Incomplete);
                }

                //If I'm mining, only unload ore. Otherwise, unload everything.
                if (_mainConfiguration.ActiveBehavior == BotModes.Mining)
                {
                    _ship.TransferOreInCargoHoldToStationCorporateHangars();
                }
                else
                {
                    _ship.TransferCargoHoldToStationCorporateHangars();
                }

                _stationDropOffState = StationDropOffStates.UnloadOreHold;
                break;

            case StationDropOffStates.UnloadOreHold:
                if (!_meCache.Ship.Ship.HasOreHold)
                {
                    _stationDropOffState = StationDropOffStates.StackHangar;
                    goto case StationDropOffStates.StackHangar;
                }

                if (!_ship.IsOreHoldActive)
                {
                    LogMessage(methodName, LogSeverityTypes.Debug, "Making my ship's ore hold active.");
                    _ship.MakeOreHoldActive();
                    return(BehaviorExecutionResults.Incomplete);
                }

                //I need to add methods for specifically unloading the ore hold.
                _ship.TransferOreHoldToStationCorporateHangars();

                _stationDropOffState = StationDropOffStates.StackHangar;
                break;

            case StationDropOffStates.StackHangar:
                if (!_station.IsStationHangarActive)
                {
                    LogMessage(methodName, LogSeverityTypes.Debug, "Making the station hangar active.");
                    _station.MakeStationHangarActive();
                    return(BehaviorExecutionResults.Incomplete);
                }

                _ship.StackInventory();

                _stationDropOffState = StationDropOffStates.RearmCharges;
                break;

            case StationDropOffStates.RearmCharges:
                var rearmComplete = _ship.RearmMiningCrystals(null);

                if (!rearmComplete)
                {
                    break;
                }

                _stationDropOffState = StationDropOffStates.Idle;
                return(BehaviorExecutionResults.Complete);
            }

            return(BehaviorExecutionResults.Incomplete);
        }
コード例 #2
0
 public override void Reset()
 {
     _stationDropOffState = StationDropOffStates.Idle;
     _jetcanDropOffState  = JetcanDropOffStates.Idle;
     _corporateHangarArrayDropOffState = CorporateHangarArrayDropOffStates.Idle;
 }
コード例 #3
0
        private BehaviorExecutionResults DropOffCargoToStation()
        {
            var methodName = "DropOffCargoToStation";

            LogTrace(methodName);

            switch (_stationDropOffState)
            {
            case StationDropOffStates.Idle:
                //Just go to the Unload Cargo state.
                _stationDropOffState = StationDropOffStates.UnloadCargoHold;
                goto case StationDropOffStates.UnloadCargoHold;

            case StationDropOffStates.UnloadCargoHold:
                if (_doDropoffRandomWait.ShouldWait())
                {
                    return(BehaviorExecutionResults.Incomplete);
                }

                if (!_ship.IsCargoHoldActive)
                {
                    LogMessage(methodName, LogSeverityTypes.Debug, "Making my ship's cargo hold active.");
                    _ship.MakeCargoHoldActive();
                    return(BehaviorExecutionResults.Incomplete);
                }

                //If I'm mining, only unload ore. Otherwise, unload everything.
                if (_mainConfiguration.ActiveBehavior == BotModes.Mining)
                {
                    _ship.TransferOreInCargoHoldToStationHangar();
                }
                else
                {
                    _ship.TransferCargoHoldToStationHangar();
                }

                _stationDropOffState = StationDropOffStates.UnloadOreHold;
                break;

            case StationDropOffStates.UnloadOreHold:
                if (!_meCache.Ship.Ship.HasOreHold)
                {
                    _stationDropOffState = StationDropOffStates.StackHangar;
                    goto case StationDropOffStates.StackHangar;
                }

                if (!_ship.IsOreHoldActive)
                {
                    LogMessage(methodName, LogSeverityTypes.Debug, "Making my ship's ore hold active.");
                    _ship.MakeOreHoldActive();
                    return(BehaviorExecutionResults.Incomplete);
                }

                //I need to add methods for specifically unloading the ore hold.
                _ship.TransferOreHoldToStationHangar();

                _stationDropOffState = StationDropOffStates.StackHangar;
                break;

            case StationDropOffStates.StackHangar:
                if (!_station.IsStationHangarActive)
                {
                    LogMessage(methodName, LogSeverityTypes.Debug, "Making the station hangar active.");
                    _station.MakeStationHangarActive();
                    return(BehaviorExecutionResults.Incomplete);
                }

                _ship.StackInventory();

                _stationDropOffState = StationDropOffStates.RearmCharges;
                break;

            case StationDropOffStates.RearmCharges:
                //See if we need to rearm crystals.
                var isRearmComplete = _ship.RearmMiningCrystals(null);

                if (!isRearmComplete)
                {
                    break;
                }

                //Set state to idle, but don't use a goto case or it'll break things.
                _stationDropOffState = StationDropOffStates.Idle;
                return(BehaviorExecutionResults.Complete);
            }
            return(BehaviorExecutionResults.Incomplete);
        }