public void shipFull() { refuelCalled = false; state = EShipState.Full; ShipEventArgs se = new ShipEventArgs(XPos, YPos); if (ShipFullEvent != null) { ShipFullEvent(this, se); } }
public void Refuel() { if (!refuelCalled) { refuelCalled = true; ShipEventArgs se = new ShipEventArgs(XPos, YPos); if (ShipEmptyEvent != null) { ShipEmptyEvent(this, se); } } else { if (fuel < 100) { fuel += 2; } else { shipFull(); } } }
public void OutOfFuelEventHandler(object shipSubject, ShipEventArgs se) { XPos = se.XPos; YPos = se.YPos; }
public void FuelFullEventHandler(object shipSubject, ShipEventArgs se) { XPos = HomeXPos; YPos = HomeYPos; }