public void CreateGame(GameSetings gameSetings, string player_name) { var connectionData = new ConectionData() { GameSetings = gameSetings, PlayerName = player_name }; Owner.Sender.SendMessage(new Package() { Sender_Passport = client.Passport, Data = connectionData, MesseggeType = MesseggeType.CreateRoom }, client["Host"]); }
private void CreateRoom_btn_Click(object sender, EventArgs e) { var gameSpeed = (int)GameSpeed_nud.Value; var object_size = (int)ObjectSize_nud.Value; Size mapSize = new Size( (int)MapWidth_nud.Value, (int)MapHeight_nud.Value); var players_count = (int)NamberOfPlayer_nud.Value; var game_type = (GameType)Enum.Parse(typeof(GameType), VictoryCondition_cb.SelectedItem.ToString()); gameSetings = new GameSetings() { GameSpeed = gameSpeed, ObjectsSize = object_size, MapSize = mapSize, MaxPlayersCount = players_count, GameType = game_type }; ok = true; Close(); }