예제 #1
0
        private void OnVisitNeighborSuccess(VisitNeighborResponse response, object cookie)
        {
            ProcessingScreen.Hide();
            if (response == null)
            {
                this.processing = false;
                return;
            }
            this.NeighborPlayer                = new GamePlayer();
            this.NeighborPlayer.PlayerName     = response.Name;
            this.NeighborPlayer.Faction        = response.Faction;
            this.NeighborPlayer.Map            = response.MapData;
            this.NeighborPlayer.Inventory      = response.InventoryData;
            this.NeighborPlayer.AttackRating   = response.AttackRating;
            this.NeighborPlayer.DefenseRating  = response.DefenseRating;
            this.NeighborPlayer.AttacksWon     = response.AttacksWon;
            this.NeighborPlayer.DefensesWon    = response.DefensesWon;
            this.NeighborPlayer.Squad          = response.Squad;
            this.NeighborPlayer.UnlockedLevels = response.UpgradesData;
            this.NeighborSquadTroops           = response.SquadTroops;
            NeighborMapDataLoader mapDataLoader = new NeighborMapDataLoader(response);
            IState             currentState     = Service.Get <GameStateMachine>().CurrentState;
            AbstractTransition transition;

            if (currentState is GalaxyState)
            {
                transition = new GalaxyMapToBaseTransition(new NeighborVisitState(), mapDataLoader, new TransitionCompleteDelegate(this.OnTransitionComplete), false, false);
            }
            else if (currentState is WarBoardState)
            {
                transition = new WarboardToWarbaseTransition(new NeighborVisitState(), mapDataLoader, new TransitionCompleteDelegate(this.OnTransitionComplete), false, false);
            }
            else
            {
                transition = new WorldToWorldTransition(new NeighborVisitState(), mapDataLoader, new TransitionCompleteDelegate(this.OnTransitionComplete), false, true);
            }
            Service.Get <WorldTransitioner>().StartTransition(transition);
        }
예제 #2
0
 public NeighborMapDataLoader(VisitNeighborResponse response)
 {
     this.response = response;
 }