private bool Setup(TransitionCompleteDelegate onComplete) { this.pendingCompletion = onComplete; HomeMapDataLoader homeMapDataLoader = Service.HomeMapDataLoader; GameStateMachine gameStateMachine = Service.GameStateMachine; bool flag = gameStateMachine.CurrentState is WarBoardState; this.transitionToHomeState = (!Service.WorldTransitioner.IsCurrentWorldHome() || flag); if (this.transitionToHomeState) { AbstractTransition transition; if (flag) { transition = new WarboardToBaseTransition(this, homeMapDataLoader, this.pendingCompletion); } else { transition = new WorldToWorldTransition(this, homeMapDataLoader, this.pendingCompletion, false, true); } Service.WorldTransitioner.StartTransition(transition); this.pendingCompletion = null; } else { gameStateMachine.SetState(this); } return(this.transitionToHomeState); }
private void ExitBaseLayoutTool(bool afterSave) { if (Service.Get <GameStateMachine>().CurrentState is WarBaseEditorState) { HomeMapDataLoader mapDataLoader = Service.Get <HomeMapDataLoader>(); Service.Get <WorldTransitioner>().StartTransition(new WarbaseToWarboardTransition(new WarBoardState(), mapDataLoader, null, false, false)); return; } if (afterSave) { HomeState.GoToHomeState(null, false); return; } Service.Get <GameStateMachine>().SetState(new EditBaseState(false)); }
private void ExitBaseLayoutTool(bool afterSave) { if (Service.GameStateMachine.CurrentState is WarBaseEditorState) { HomeMapDataLoader homeMapDataLoader = Service.HomeMapDataLoader; Service.WorldTransitioner.StartTransition(new WarbaseToWarboardTransition(new WarBoardState(), homeMapDataLoader, null, false, false)); } else if (afterSave) { HomeState.GoToHomeState(null, false); } else { Service.GameStateMachine.SetState(new EditBaseState(false)); } }
public void PurchaseNextBattle() { HomeMapDataLoader homeMapDataLoader = Service.Get <HomeMapDataLoader>(); WorldToWorldTransition transition = new WorldToWorldTransition(null, homeMapDataLoader, null, false, false); Service.Get <WorldTransitioner>().StartWipe(transition, homeMapDataLoader.GetPlanetData()); this.KillTimer(); PvpGetNextTargetRequest request = new PvpGetNextTargetRequest(); this.nextTargetCommand = new PvpGetNextTargetCommand(request); this.nextTargetCommand.AddSuccessCallback(new AbstractCommand <PvpGetNextTargetRequest, PvpTarget> .OnSuccessCallback(this.OnPvpTargetFound)); this.nextTargetCommand.AddFailureCallback(new AbstractCommand <PvpGetNextTargetRequest, PvpTarget> .OnFailureCallback(this.OnPvpError)); Service.Get <ServerAPI>().Sync(this.nextTargetCommand); this.StartSearchTimer(); Service.Get <TournamentController>().EnterPlanetConflict(); Service.Get <UserInputInhibitor>().DenyAll(); }