예제 #1
0
        public void Awake()
        {
            mPassedState = State.StateHolder.StateManager.GetAndClearPassedState();
            if (mPassedState != null && mPassedState.mType == State.PassedStateType.CardGameResult)
            {
                mMapState      = State.StateHolder.StateManager.LoadMapState();
                mCampaignState = State.StateHolder.StateManager.LoadCampaignState();
                ApplyCardGameResult((State.CardGameResult)mPassedState);
            }
            else
            {
                bool createMap = false;
                // TODO - Consider other passed states, such as being passed a map.
                // Do we need this? Maybe the map is always 'passed' by loading it globally?
                if (mPassedState != null && mPassedState.mType == State.PassedStateType.Map)
                {
                    createMap = ((State.MapSetupState)mPassedState).mCreateNewMap;
                }

                if (createMap)
                {
                    mMapState = new MapState(kNumMapLayers, 0);
                    State.StateHolder.StateManager.SetMapState(mMapState);
                }
                else
                {
                    mMapState = State.StateHolder.StateManager.LoadMapState();
                    mMapState.CheckMapCompleted();
                }
                mCampaignState = State.StateHolder.StateManager.LoadCampaignState();
            }
            mMapUIManager = this.gameObject.GetComponent <Map.UI.MapUIManager>();
        }
예제 #2
0
 public void VictoryAtCurrentLocation(State.CampaignState campaignState)
 {
     LocationCompleted(mCurrentLocation.mItem);
     mCurrentLocation.mItem.Completed     = true;
     mCurrentLocation.mItem.mDidPlayerWin = true;
     foreach (Cards.Entities.Entity rewardCard in mCurrentLocation.mItem.Rewards.Cards)
     {
         campaignState.mCurrentCollection.mDeck.IncrementEntry(rewardCard.Name, 1);
     }
     UpdateMapState();
 }
예제 #3
0
 public void DefeatAtCurrentLocation(State.CampaignState campaignState)
 {
     LocationCompleted(mCurrentLocation.mItem);
     mCurrentLocation.mItem.Completed = true;
     UpdateMapState();
 }