Пример #1
0
 public virtual void UpdateWith(BattleHeader h)
 {
     if (h.BattleID != null)
     {
         BattleID = h.BattleID.Value;
     }
     if (h.Founder != null)
     {
         FounderName = h.Founder;
     }
     if (h.MaxPlayers != null)
     {
         MaxPlayers = h.MaxPlayers.Value;
     }
     if (!string.IsNullOrEmpty(h.Password))
     {
         Password = h.Password;
     }
     if (h.Engine != null)
     {
         EngineVersion = h.Engine;
     }
     if (h.Map != null)
     {
         MapName = h.Map;
     }
     if (h.Title != null)
     {
         Title = h.Title;
     }
     if (h.Game != null)
     {
         ModName = h.Game;
     }
     if (h.SpectatorCount != null)
     {
         SpectatorCount = h.SpectatorCount.Value;
     }
     if (h.PlayerCount != null)
     {
         NonSpectatorCount = h.PlayerCount.Value;
     }
     if (h.Mode != null)
     {
         Mode = h.Mode.Value;
     }
     if (h.RunningSince != null)
     {
         RunningSince = h.RunningSince;
     }
     if (h.IsRunning != null)
     {
         IsInGame = h.IsRunning.Value;
     }
     if (h.IsMatchMaker != null)
     {
         IsMatchMakerBattle = h.IsMatchMaker.Value;
     }
 }
Пример #2
0
 public Task OpenBattle(BattleHeader header)
 {
     if (MyBattle != null)
     {
         LeaveBattle();
     }
     return(SendCommand(new OpenBattle()
     {
         Header = header
     }));
 }
Пример #3
0
 public virtual void UpdateWith(BattleHeader h)
 {
     if (h.BattleID != null) BattleID = h.BattleID.Value;
     if (h.Founder != null) FounderName = h.Founder;
     if (h.MaxPlayers != null) MaxPlayers = h.MaxPlayers.Value;
     if (!string.IsNullOrEmpty(h.Password)) Password = h.Password;
     if (h.Engine != null) EngineVersion = h.Engine;
     if (h.Map != null) MapName = h.Map;
     if (h.Title != null) Title = h.Title;
     if (h.Game != null) ModName = h.Game;
     if (h.SpectatorCount != null) SpectatorCount = h.SpectatorCount.Value;
     if (h.Mode != null) Mode = h.Mode.Value;
     if (h.RunningSince != null) RunningSince = h.RunningSince;
     if (h.IsRunning != null) IsInGame = h.IsRunning.Value;
 }
Пример #4
0
 public void UpdateWith(BattleHeader h, Func <string, User> getUser)
 {
     this.getUser = getUser;
     if (h.BattleID != null)
     {
         BattleID = h.BattleID.Value;
     }
     if (h.Founder != null)
     {
         FounderName = h.Founder;
     }
     if (h.Ip != null)
     {
         Ip = h.Ip;
     }
     if (h.Port != null)
     {
         HostPort = h.Port.Value;
     }
     if (h.MaxPlayers != null)
     {
         MaxPlayers = h.MaxPlayers.Value;
     }
     if (h.Password != null)
     {
         Password = h.Password;
     }
     if (h.Engine != null)
     {
         EngineVersion = h.Engine;
     }
     if (h.Map != null)
     {
         MapName = h.Map;
     }
     if (h.Title != null)
     {
         Title = h.Title;
     }
     if (h.Game != null)
     {
         ModName = h.Game;
     }
     if (h.SpectatorCount != null)
     {
         SpectatorCount = h.SpectatorCount.Value;
     }
 }
Пример #5
0
 public void UpdateWith(BattleHeader h, Func<string, User> getUser)
 {
     this.getUser = getUser;
     if (h.BattleID != null) BattleID = h.BattleID.Value;
     if (h.Founder != null) FounderName = h.Founder;
     if (h.Ip != null) Ip = h.Ip;
     if (h.Port != null) HostPort = h.Port.Value;
     if (h.MaxPlayers != null) MaxPlayers = h.MaxPlayers.Value;
     if (h.Password != null) Password = h.Password;
     if (h.Engine != null) EngineVersion = h.Engine;
     if (h.Map != null) MapName = h.Map;
     if (h.Title != null) Title = h.Title;
     if (h.Game != null) ModName = h.Game;
     if (h.SpectatorCount != null) SpectatorCount = h.SpectatorCount.Value;
 }