public class Woman : Human
{
int balance = 5312;
Man boyfriend;
bool isSimple;
string name;
public Woman(string name) { this.name = name; this.isSimple = false; }
public void GetBoyfriend(Man bf)
{
this.balance -= man.balance;
man.balance -= man.balance;
}
}
public class Man : Human
{
int balance = 69420;
Woman girlfriend;
bool isSimple;
string name;
public Man(string name)
{
this.name = name;
this.isSimple = true;
}
void GetGirlfriend(Woman plsBeMyGfUwU)
{
if (Math.random() < 0.1) Talk(plsBeMyGfUwU); // Error: Man has no Function called Talk (Probably he is too scared to talk)
else WalkAway();
throw new ScaryException($"{this.name} is scared either way");
plsBeMyGfUwU.GetBoyfriend(this); // Error: Unreachable Code detected!
}
// ...
}
public class Main {
void Main()
{
Man man = new("Johnson");
Woman woman = new("Your mum");
try {
man.GetGirlfriend(woman);
}
catch (Exception ex)
{
Debug.Log("Getting a Girlfriend failed!");
}
}
}