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; } }
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); } }
private void UpdateLocalPlayerStage() { ServerSend.UpdateLocalPlayerTutorialStag(currentTutorialPlayer.GetPlayerId(), (int)currentPlayerStage); }
public IEnumerable <PlayerDataHolder> GetAllPlayers(PlayerDataHolder except) { var allPLayers = _team1.Concat(_team2).Where(w => w.GetPlayerId() != except.GetPlayerId()); return(allPLayers.ToList()); }