private IEnumerator DoIt(BS_MatchParams info, BS_MatchResult result) { string label = ""; foreach (var teamId in info.TeamIds) { BS_Team team = GM_Game.Finder.Get <BS_Team>(teamId); if (label.Length == 0) { label = "Team "; } else { label += " vs "; } label += team.DisplayName; } GM_Game.Popup.ShowPopup(label, "Simulating Match"); for (int i = 0; i < 5; i++) { yield return(null); } _isRunning = false; Dbg.Log("Match simulation finished"); GM_Game.Popup.ClearStatus(true); }
// ------------------------------------------------------------------------------ /// <summary> /// This is called while still in the league scene to set up the match for play. /// It configures some data and moves to the given arena /// </summary> /// <param name="matchParam"></param> /// <param name="arena"></param> public void StartMatch(BS_MatchParams matchParam, LG_ArenaDescriptor arena) // ------------------------------------------------------------------------------ { _arenaDesc = arena; _matchState = State.Loading; _matchResult = new BS_MatchResult(); SetTeams(matchParam, PT_Game.League); // if we don't have an rena, then we are doing a simulated match. if (_arenaDesc == null) { _matchState = State.Running; _matchSimulator.Run(matchParam, _matchResult); } else // otherwise, load that level and go to town with the mission { PT_GamePhaseMatch gpMatch = PT_Game.Phases.GetPhase <PT_GamePhaseMatch>(); gpMatch.SceneName = arena.Name; PT_Game.Phases.QueuePhase(gpMatch); } }
public void Run(BS_MatchParams info, BS_MatchResult result) { Dbg.Assert(_isRunning == false); StartCoroutine(DoIt(info, result)); }