Пример #1
0
        internal static void AbortGame(string gameId)
        {
            var game = TronGameService.GetExistingGame(gameId);

            //TODO: Abort game
            //game.Abort()

            TronGameService.RemoveGame(gameId);
        }
Пример #2
0
        internal static void StartGame(HubMediator mediator, string gameId, ushort borderWidth, ushort borderHeight)
        {
            var tronGame = new Tron(mediator, gameId, borderWidth, borderHeight);

            tronGame.GameOver  += GameOver;
            tronGame.TurnMoved += TurnMoved;

            TronGameService.AddNewGame(gameId, tronGame);

            tronGame.Play();
        }
Пример #3
0
        internal static void KeyPressed(string gameId, Keys keyPressed)
        {
            var game = TronGameService.GetExistingGame(gameId);

            game.ChangePlayerDirection(keyPressed);
        }