//Initializes the game for each level. void InitGame() { tavernRevealed = new Dictionary <int, bool>(); tavernHeroes = new Dictionary <int, List <Hero> >(); dataModel = GameObject.Find("DataModal").GetComponent <DataModal>(); dataModel.Load(); missionNumber = 1; activeQuests = dataModel.GetAllQuestForAMission(missionNumber); TimeElapsed = 6; UpdateTimeDisplay(); var tavernData = dataModel.GetComponent <DataModal>().TavernData; var tavernsOnMap = FindObjectsOfType <TavernOnMap>(); foreach (var tavern in tavernsOnMap) { var data = dataModel.TavernData.Find(x => x.TavernID == tavern.id); tavern.types = data.Heroes.ToArray(); tavern.averageLevel = data.AveragePowerLevel; } }
internal void NextMission() { missionNumber++; activeQuests = dataModel.GetAllQuestForAMission(missionNumber); }