This commit is contained in:
Nándor Árgyelán 2024-10-01 13:00:31 +02:00
parent 7bcea4ea02
commit f160a58466
5 changed files with 49 additions and 1 deletions

View File

@ -18,6 +18,9 @@ namespace SzimulacioOOP
public Auto(String Nev) {
this.Nev = Nev;
TankMeret = 50;
Random rd = new Random();
Fogyasztas = rd.NextDouble() *7.5 + 2.5;
Uzemanyag = rd.NextDouble() * 50;
}
}
}

View File

@ -12,6 +12,15 @@ namespace SzimulacioOOP
public double BenzinAr { get; set; }
public double Kassza { get; set; }
public Benzinkut()
{
Kassza = 0;
BenzinAr = 480;
Random rd = new Random();
Keszlet = rd.NextDouble() * 2000 + 55;
}
public bool Tankolas(Auto kocsi)
{
return false;

View File

@ -12,7 +12,37 @@ namespace SzimulacioOOP
public Fonok Igazgato { get; set; }
public List<Sofor> Vezetok { get; set; }
private int Autodb;
public Benzinkut Benzinkut { get; set; }
public Ceg() { }
public Ceg() {
Igazgato = new Fonok("Nagy Főnök");
Benzinkut = new Benzinkut();
Autodb = 5;
GenSoforok();
GenAutok();
}
private void GenAutok()
{
Autok = new List<Auto>();
for (int i = 0; i < Autodb; i++)
{
Autok.Add(new Auto($"ceges{i}"));
}
}
private void GenSoforok()
{
Vezetok = new List<Sofor>();
for (int i = 0; i < Autodb; i++)
{
Vezetok.Add(new Sofor($"sofor-{i}"));
}
}
internal void SzimulacioIndul()
{
throw new NotImplementedException();
}
}
}

View File

@ -11,6 +11,10 @@ namespace SzimulacioOOP
public double Tarca { get; set; }
public Sofor(string Nev) : base(Nev)
{
Random rd = new Random();
Tarca = rd.NextDouble() * 22000 + 2000;
}
}
}

View File

@ -10,6 +10,8 @@ namespace SzimulacioOOP
{
static void Main(string[] args)
{
Ceg ceg = new Ceg();
ceg.SzimulacioIndul();
}
}
}