Ejemplo n.º 1
0
    /// <summary>
    ///
    /// Used for checking if the game is initialised properly. If not, then sets up a default set of players and map
    /// Mostly used for testing if loading into game from gameplay scene. Change default decks and map as required
    ///
    /// </summary>
    public void CheckGameLoad()
    {
        //If the phase is still menu, this means the gameplay data has not been loaded, as such, requiring default decks
        if (CurrentGamePhase == GamePhases.Menu)
        {
            CampaignDeck = null;

            var orderedNPCDecks = deckManager.NPCDeckList.OrderBy(x => x.Id);
            var defaultDecks    = new DeckData[]
            {
                orderedNPCDecks.FirstOrDefault(),
                //deckManager.NPCDeckList.FirstOrDefault(),
                orderedNPCDecks.FirstOrDefault(x => x != deckManager.NPCDeckList.FirstOrDefault()), //Gets the second NPC Deck in the List
            };
            var defaultMap        = scenarioManager.GetMaps().FirstOrDefault();
            var defaultScenarioId = defaultMap.Scenarios.FirstOrDefault().Id.Value;

            LoadGameplayData(defaultDecks, defaultMap, defaultScenarioId);
        }
    }