/// <summary> /// Event for when a ship needs fuel /// </summary> public void OnNeedsFuelEvent() { ShipEventArgs se = new ShipEventArgs(location); if (NeedsFuelEvent != null) NeedsFuelEvent(this, se); }
public void OutOfFuelEventHandler(object sender, ShipEventArgs e) { // Set the refueler lcoation to be the same as the current ship location botCurrentLocation = botShip.ShipLocation; botShip.Refuel(); }
/// <summary> /// Event for ship refueling complete /// </summary> public void OnRefuelingCompleteEvent() { ShipEventArgs se = new ShipEventArgs(location); if (RefuelingCompleteEvent != null) RefuelingCompleteEvent(this, se); }
/// <summary> /// Event raised when a ship needs fuel, will select a waiting bot and dispatch them to the ship /// </summary> /// <param name="sender">Ship</param> /// <param name="se">fuel, ID</param> private void needFuelHandler(object sender, ShipEventArgs se) { if (isBotsReadyForRefueling()) { Bot botForRefueling = selectBotForRefueling(); botForRefueling.Dispatch((Ship)sender, se.Location); } }
public void OutOfFuelEventHandler(object ship, ShipEventArgs shipArgs) { shipLocation = botShip.getShipLocation(); botCurrentLocation = shipLocation; botShip.Refuel(); }
/// <summary> /// Event raised when a ship needs fuel, will select a waiting bot and dispatch them to the ship /// </summary> /// <param name="sender">Ship</param> /// <param name="se">fuel, ID</param> private void needFuelHandler(object sender, ShipEventArgs se) { if (isBotsReadyForRefueling()) { Bot botForRefueling = selectBotForRefueling(); botForRefueling.Dispatch((Ship)sender, se.Location); } }
public void OutOfFuelEventHandler(object ship, ShipEventArgs shipArgs) { shipLocation = botShip.getShipLocation(); botCurrentLocation = shipLocation; botShip.Refuel(); }
public void OnFullOfFuelEvent() { ShipEventArgs e = new ShipEventArgs(shipState); if (FullOfFuelEvent != null) { FullOfFuelEvent(this, e); } }
/// <summary> /// Event for ship refueling complete /// </summary> public void OnRefuelingCompleteEvent() { ShipEventArgs se = new ShipEventArgs(location); if (RefuelingCompleteEvent != null) { RefuelingCompleteEvent(this, se); } }
/// <summary> /// Event for when a ship needs fuel /// </summary> public void OnNeedsFuelEvent() { ShipEventArgs se = new ShipEventArgs(location); if (NeedsFuelEvent != null) { NeedsFuelEvent(this, se); } }
public void OnOutOfFuelEvent() { ShipEventArgs shipArgs = new ShipEventArgs(shipState); if (OutOfFuelEvent != null) { OutOfFuelEvent(this, shipArgs); } }
/// <summary> /// Find the bot that serviced the ship that rasied the event and send home /// </summary> /// <param name="sender">Ship</param> /// <param name="se">fuel, ID</param> private void refuelingCompleteHandler(object sender, ShipEventArgs se) { foreach (Bot bot in bots) { if (bot.refuelingShip != null && bot.refuelingShip.Equals((Ship)sender)) { bot.SendHome(); } } }
public void OnOutOfFuelEvent() { // Instantiate the custom event ShipEventArgs e = new ShipEventArgs(shipState); // Is null if no methods have been registered if (OutOfFuelEvent != null) { // Raises the event OutOfFuelEvent(this, e); } }
public void FullOfFuelEventHandler(object ship, ShipEventArgs shipArgs) { botCurrentLocation = botStartingLocation; }
public void FullOfFuelEventHandler(object ship, ShipEventArgs shipArgs) { botCurrentLocation = botStartingLocation; }
public void OnOutOfFuelEvent() { ShipEventArgs shipEventArgs = new ShipEventArgs(xPos, yPos); if (OutOfFuelEvent != null) { OutOfFuelEvent(this, shipEventArgs); } }
// This method is run when the assigned\subject ship signals it is out of fuel public void OutOfFuelEventHandler(object o, ShipEventArgs e) { //The local ship location variable is updated with the jubject slocation from the passed in data bucket. shipLocation = e.ShipLocation; //and the bot starts sailing. botState = BotState.SailingtoShip; }
public void OnOutOfFuelEvent() { ShipEventArgs shipArgs = new ShipEventArgs(shipState); if (OutOfFuelEvent != null) OutOfFuelEvent(this, shipArgs); }
public void OutOfFuelEvent(object ship, ShipEventArgs e) { xPos = e.XPos; yPos = e.YPos; drawBot(); }
public void FullOfFuelEvent(object ship, ShipEventArgs e) { xPos = startXPos; yPos = startYPos; drawBot(); }
public void FullOfFuelEventHandler(object ship, ShipEventArgs shipArgs) { // Reset petrolBots to initital position botCurrentLocation = botStartingLocation; }
/// <summary> /// Find the bot that serviced the ship that rasied the event and send home /// </summary> /// <param name="sender">Ship</param> /// <param name="se">fuel, ID</param> private void refuelingCompleteHandler(object sender, ShipEventArgs se) { foreach (Bot bot in bots) if (bot.refuelingShip != null && bot.refuelingShip.Equals((Ship)sender)) bot.SendHome(); }
public void OnOutOfFuelEvent(Point ShipCurrentlocation) { ShipEventArgs se = new ShipEventArgs(ShipCurrentlocation); if (OutOfFuelEvent != null) { OutOfFuelEvent(this, se); } }
public void OutOfFuelEventHandler(object o, ShipEventArgs e) { botCurrentlocation = e.ShipLocation; }