Exemplo n.º 1
0
        public async Task<ILobby> CreateLobby(GameConfiguration configuration, int port)
        {
            using (var client = new HttpClient())
            {
                var data = new GameData() { Id = Guid.NewGuid(), IP = "127.0.0.1", Port = 1337, Name = "Hello World Game" };
                var response = await client.PostAsync(URL, data, new JsonMediaTypeFormatter());
            }

            var moderator = new Player(user.Id, user.Name);
            ILobby lobby = new DummyLobby(moderator);
            return lobby;
        }
Exemplo n.º 2
0
        private async void CreateLobby()
        {
            if (!CanCreateLobby) return;

            var configuration = new GameConfiguration(SelectedMap, SelectedPlayerCount);
            ILobby lobby = await gameConfigurator.CreateLobby(configuration, Port);
            await navigationService.Navigate<LobbyViewModel>(new TypedParameter(typeof(ILobby), lobby));
        }