private void PlayerCreateButton_Click(object sender, EventArgs e)
 {
     PlayerRepository repos = new PlayerRepository();
     if (NewPlayerTextBox.Text != "")
     {
         if (freestats == 0)
         {
             if (!repos.IsExist(NewPlayerTextBox.Text))
             {
                 Player pl = new Player(NewPlayerTextBox.Text, str, agi, stm);
                 repos.Add(pl);
                 SwitchScene(Scene.Menu, pl);
             }
             else
             {
                 MessageBox.Show("This name is already taken");
             }
         }
         else
         {
             MessageBox.Show("Use all stats");
         }
     }
     else
     {
         MessageBox.Show("Input name");
     }
 }
Exemplo n.º 2
0
        public RecordTableUserControl(object par)
        {
            InitializeComponent();

            RecordTable.DataSource = repos.GetAll().ToList();
            player1 = (Player)par;
        }
Exemplo n.º 3
0
 void DrawPlayerInfo(Player player)
 {
     PlayerNameLabel.Text = player.Name;
     PlayerExpLabel.Text = player.Exp.ToString();
 }
Exemplo n.º 4
0
 public MenuUserControl(object param)
 {
     InitializeComponent();
     MainPlayer = (Player)param;
     DrawPlayerInfo(MainPlayer);
 }
 public SecondPlayerLoadUserControl(object par)
 {
     InitializeComponent();
     player1 = (Player)par;
 }