示例#1
0
        public void shipFull()
        {
            refuelCalled = false;
            state        = EShipState.Full;
            ShipEventArgs se = new ShipEventArgs(XPos, YPos);

            if (ShipFullEvent != null)
            {
                ShipFullEvent(this, se);
            }
        }
示例#2
0
 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();
         }
     }
 }
示例#3
0
 public void OutOfFuelEventHandler(object shipSubject, ShipEventArgs se)
 {
     XPos = se.XPos;
     YPos = se.YPos;
 }
示例#4
0
 public void FuelFullEventHandler(object shipSubject, ShipEventArgs se)
 {
     XPos = HomeXPos;
     YPos = HomeYPos;
 }