예제 #1
0
 private void OnGamerJoin(Gamer joined)
 {
     if (joined.IsLocal)
         myGamer = joined as LocalGamer;
 }
예제 #2
0
 private void ClearGamer(Gamer gamer)
 {
     this.gamer = null;
     Wins = 0;
     Losses = 0;
 }
예제 #3
0
 private void OnHostChanged(Gamer oldHost, Gamer newHost)
 {
     Engine.Instance.Scene = new MenuScene(MenuScene.ReturnState.Lobby);
 }
예제 #4
0
 private void SetGamer(Gamer gamer)
 {
     LocalGamer local = gamer as LocalGamer;
     this.gamer = local;
     local[(int)TestProject.GamerProperties.ShipColor] = local[(int)TestProject.GamerProperties.Losses] = local[(int)TestProject.GamerProperties.Wins] = 0;
 }
예제 #5
0
        private void OnGamerLeave(Gamer left)
        {
            foreach (var ship in Ships[left])
                Ships.DestroyObjectLocal(ship);
            foreach (var bullet in Bombs[left])
                Bombs.DestroyObjectLocal(bullet);

            if (Network.ActiveSession.NumGamers == 1 && Network.ActiveSession.IsHost)
            {
                quitToLobby = true;
                Network.ActiveSession.EndGame();
            }
        }