CloudWars.SpaceBattle.SpaceBattleGame.SpaceBattleGame C# (CSharp) Метод

SpaceBattleGame() публичный Метод

public SpaceBattleGame ( System.Guid matchId, bool loadMatchData ) : System
matchId System.Guid
loadMatchData bool
Результат System
        public SpaceBattleGame(Guid matchId, bool loadMatchData)
        {
            //load the match
            if (loadMatchData)
            {
                var m = CloudWarsData.GetMatch(matchId);
                this.MatchId = m.Id;
                this.Player1 = m.Player1;
                this.Player2 = m.Player2;
                this.Player1Ready = m.Player1Ready;
                this.Player2Ready = m.Player2Ready;
                this.Turn = m.Turn;
                this.Initialized = m.Initialized;
                this.MatchEnded = m.MatchEnded;
                this.Winner = m.Winner;
                this.PlayingNow = m.PlayingNow;
                //Get the units
                var dbUnits = CloudWarsData.GetUnits(matchId);
                Units = new List<IGameUnit>();
                foreach (var u in dbUnits)
                {
                    Units.Add(new GameUnit(u));
                }
            }
            else
            {
                this.MatchId = matchId;
            }
        }

Same methods

SpaceBattleGame::SpaceBattleGame ( ) : System