Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     using (var game = new GameForm(new GameSession(), new GameSettings()))
     {
         game.Run();
     }
 }
Beispiel #2
0
 static void Main()
 {
     using (var game = new GameForm(new Core.Game.GameSession(), new Core.Game.GameSettings()))
         game.Run();
 }
Beispiel #3
0
        private void buttonCreateGame_Click(object sender, EventArgs e)
        {
            var packet = new LobbyBroadcastPacket();
            packet.Id = Guid.NewGuid();
            packet.SessionName = textBoxSessionName.Text;
            packet.SessionCreator = textBoxPlayerName.Text;
            packet.FieldHeight = Convert.ToInt32(textBoxFieldHeight.Text);
            packet.FieldWidth = Convert.ToInt32(textBoxFieldWIdth.Text);
            packet.Ip = GetMulticastIp();

            Broadcaster.BroadcastGameSession<LobbyBroadcastPacket>(() => { return packet; });

            var gameSession = AddLobbyGameSession(packet);

            using (var game = new GameForm(gameSession, new GameSettings
            {
                PlayerName = textBoxPlayerName.Text,
                Team = GetTeam()
            }))
            {
                game.Run();
            }
        }
Beispiel #4
0
        private void buttonJoinGame_Click(object sender, EventArgs e)
        {
            if (listBoxLobby.SelectedItem != null)
            {
                var selected = listBoxLobby.SelectedItem.ToString();

                var gameSession = _gameSessions.FirstOrDefault(s => selected.Contains(s.GetKey()));
                if (gameSession != null)
                {
                    var random = new Random();
                    using (var game = new GameForm(gameSession, new GameSettings { PlayerName = textBoxPlayerName.Text, Team = GetTeam() }))
                    {
                        game.Run();
                    }
                }
            }
        }
Beispiel #5
0
 static void Main()
 {
     using (var game = new GameForm(new Core.Game.GameSession(), new Core.Game.GameSettings()))
         game.Run();
 }