Zweiter Konstruktor für User und Spiele klasse anlegen

This commit is contained in:
NBTEMP\bib
2026-08-19 13:55:33 +02:00
parent 1220484e31
commit d493d32f1f
2 changed files with 28 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Casino
{
public class Spiele
{
public string Name { get; set; }
public int MinBetrag { get; set; }
public Spiele(string n, int m)
{
Name = n;
MinBetrag = m;
}
}
}
+8 -1
View File
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Casino namespace Casino
{ {
class User public class User
{ {
public string ID { get; } public string ID { get; }
public string Name { get; set; } public string Name { get; set; }
@@ -19,6 +19,13 @@ namespace Casino
Alter = a; Alter = a;
Geld = 1000; Geld = 1000;
} }
public User(string id, string n, int a, int g)
{
ID = id;
Name = n;
Alter = a;
Geld = g;
}
private string ID_Generation() private string ID_Generation()
{ {