// Join Game
        private void JoinGame(string gameId)
        {
            Application.Current.Dispatcher.Invoke(() => Popup?.CloseAction());
            Console.WriteLine($"Joining game: {gameId}");


            EventManager.Instance.Interrupt(new ChangeStateEvent()
            {
                NextState = Enums.States.OnlineGame
            });
            var joinEvent = new JoinOnlineGameRequestEvent()
            {
                HashId    = gameId,
                IsPrivate = false,
                Name      = ""
            };

            EventManager.Instance.Notice(joinEvent);
        }
예제 #2
0
        /// <summary>
        /// Join the found game
        /// </summary>
        public void JoinGame()
        {
            if (FoundGame == null)
            {
                Console.WriteLine("No game has been found, you can't join what doesn't exist");
                return;
            }

            EventManager.Instance.Interrupt(new ChangeStateEvent()
            {
                NextState = Enums.States.OnlineGame
            });
            var joinEvent = new JoinOnlineGameRequestEvent()
            {
                HashId    = FoundGame.HashId,
                IsPrivate = FoundGame.IsPrivate,
                Name      = FoundGame.Name
            };

            EventManager.Instance.Notice(joinEvent);
            CloseAction();
        }