public MissionScoreboardComponent(string gameMode)
 {
     this._spectators      = new List <MissionPeer>();
     this._sides           = new MissionScoreboardComponent.MissionScoreboardSide[2];
     this._roundWinnerList = new List <BattleSideEnum>();
     ScoreboardFactory.Register("Duel", (IScoreboardData) new DuelScoreboardData());
     ScoreboardFactory.Register("Skirmish", (IScoreboardData) new SkirmishScoreboardData());
     ScoreboardFactory.Register("Captain", (IScoreboardData) new CaptainScoreboardData());
     ScoreboardFactory.Register("Battle", (IScoreboardData) new BattleScoreboardData());
     ScoreboardFactory.Register("FreeForAll", (IScoreboardData) new FFAScoreboardData());
     ScoreboardFactory.Register("TeamDeathmatch", (IScoreboardData) new TDMScoreboardData());
     ScoreboardFactory.Register("Siege", (IScoreboardData) new SiegeScoreboardData());
     this._scoreboardData = ScoreboardFactory.Get(gameMode);
 }
 public override void OnRemoveBehaviour()
 {
     this._spectators.Clear();
     for (int index = 0; index < 2; ++index)
     {
         if (this._sides[index] != null)
         {
             this._sides[index].Clear();
         }
     }
     MissionPeer.OnTeamChanged -= new MissionPeer.OnTeamChangedDelegate(this.TeamChange);
     VirtualPlayer.OnPeerComponentPreRemoved  -= new Action <VirtualPlayer, PeerComponent>(this.OnPeerComponentPreRemoved);
     NetworkCommunicator.OnPeerComponentAdded -= new Action <PeerComponent>(this.OnPeerComponentAdded);
     if (GameNetwork.IsServerOrRecorder && this._mpGameModeBase.RoundComponent != null)
     {
         this._mpGameModeBase.RoundComponent.OnRoundEnding -= new Action(this.OnRoundEnding);
     }
     ScoreboardFactory.Clear();
     base.OnRemoveBehaviour();
 }