コード例 #1
0
    public GamePLay(int gameMap, Match myMatch)
    {
        this.myMatch = myMatch;
        if (myMatch.matchType == MatchType.Tutorial)
        {
            currentTutorialPlayer = myMatch.currentPlayer;
            currentPlayerStage    = TutorialStage.Introduction;
            ServerSend.BeginTutorial(currentTutorialPlayer.GetPlayerId());
        }
        else
        {
            this.gameMap = (Map)gameMap;
            foreach (var player in myMatch.GetTeam1())
            {
                team1Zones.Add(player.GetPlayerId(), -1);
                gamePlayers.Add(new InternalPlayerMethods(1, player.GetPlayerId(), this.myMatch.MatchLobby.currentPick[player.GetPlayerId()], this));
            }
            foreach (var player in myMatch.GetTeam2())
            {
                team2Zones.Add(player.GetPlayerId(), -1);
                gamePlayers.Add(new InternalPlayerMethods(2, player.GetPlayerId(), this.myMatch.MatchLobby.currentPick[player.GetPlayerId()], this));
            }

            UpdateGamePlay     += UpdateMethod;
            FastUpdateGamePlay += FastUpdateMethod;
        }
    }
コード例 #2
0
 public static void PlayerRotation(PlayerDataHolder player, List <int> sendToList)
 {
     using (var packet = new Packet((int)ServerPackets.playerRotation))
     {
         packet.Write(player.GetPlayerId());
         packet.Write(player.GetGameObject().transform.rotation);
         SendTcpDataToList(packet, sendToList);
     }
 }
コード例 #3
0
 private void UpdateLocalPlayerStage()
 {
     ServerSend.UpdateLocalPlayerTutorialStag(currentTutorialPlayer.GetPlayerId(), (int)currentPlayerStage);
 }
コード例 #4
0
 public IEnumerable <PlayerDataHolder> GetAllPlayers(PlayerDataHolder except)
 {
     var allPLayers = _team1.Concat(_team2).Where(w => w.GetPlayerId() != except.GetPlayerId()); return(allPLayers.ToList());
 }