Пример #1
0
 public Player(WebSocket socket, TaskCompletionSource <object> playerDisconnected, Arena arena, PlayerCollection connectionHandler, Color color)
     : this(socket, playerDisconnected, arena, connectionHandler, arena.GetSpawnPoint(), color)
 {
 }
Пример #2
0
        private Player(WebSocket socket, TaskCompletionSource <object> playerDisconnected, Arena arena, PlayerCollection connectionHandler, Point spawnPoint, Color color)
        {
            Socket             = socket;
            PlayerDisconnected = playerDisconnected;
            Arena             = arena;
            ConnectionHandler = connectionHandler;
            Snake             = new Snek(arena, spawnPoint, color);

            Task.Run(HandleDirectionChanges);
        }