using System.Windows.Forms;
public partial class CharacterCreationForm : Form
private Character player;
public CharacterCreationForm()
private void CharacterCreationForm_Load(object sender, EventArgs e)
raceComboBox.Items.Add("Човек");
raceComboBox.Items.Add("Елф");
raceComboBox.Items.Add("Джудже");
raceComboBox.Items.Add("Джудже");
classComboBox.Items.Add("Воин");
classComboBox.Items.Add("Маг");
classComboBox.Items.Add("Ловец");
classComboBox.Items.Add("Жрец");
private void createButton_Click(object sender, EventArgs e)
string name = nameTextBox.Text;
string race = raceComboBox.SelectedItem.ToString();
string characterClass = classComboBox.SelectedItem.ToString();
int strength = (int)strengthNumericUpDown.Value;
int agility = (int)agilityNumericUpDown.Value;
int intellect = (int)intellectNumericUpDown.Value;
int remainingPoints = 25 - strength - agility - intellect;
if (remainingPoints >= 0)
player = new Character(name, race, characterClass, strength, agility, intellect);
MessageBox.Show("Героят е създаден успешно!");
MessageBox.Show("Невалидно разпределение на точките! Оставащите точки трябва да бъдат неотрицателни.");
public string Name { get; set; }
public string Race { get; set; }
public string Class { get; set; }
public int Strength { get; set; }
public int Agility { get; set; }
public int Intellect { get; set; }
public Character(string name, string race, string characterClass, int strength, int agility, int intellect)