add Programmyday form github
This commit is contained in:
35
Parkplatz/Parkboxen.cs
Normal file
35
Parkplatz/Parkboxen.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Parkplatz
|
||||
{
|
||||
internal class Parkboxen
|
||||
{
|
||||
private Auto? auto;
|
||||
|
||||
public bool einparken(Auto auto)
|
||||
{
|
||||
if (this.auto == null)
|
||||
{
|
||||
this.auto = auto;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
public Auto ausparken(string kennzeichen)
|
||||
{
|
||||
if (this.auto.GetKennzeichen() == kennzeichen)
|
||||
{
|
||||
Auto h = this.auto;
|
||||
this.auto = null;
|
||||
return h;
|
||||
}
|
||||
else return null;
|
||||
}
|
||||
public bool istleer() { return this.auto == null; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user