/// <summary> /// Is called when amount of cargo received /// </summary> /// <param name="cargo"></param> private void OnCargoReceived(CargoController cargo) { int value = cargo.GetAmount(); int emptySlot = CheckEmpty(); OilType type = cargo.GetCargoType(); if (value != 0 && emptySlot > 0 && type == OilType.CrudeOil) { FillOil(value); } else if (type != OilType.CrudeOil) { MessageBroker.Default.Publish(new NotificationMessage() { Warning = NotificationType.WrongType }); } else if (value == 0 && type == OilType.CrudeOil) { MessageBroker.Default.Publish(new NotificationMessage() { Warning = NotificationType.CargoEmpty }); } else if (value != 0 && emptySlot == 0 && type == OilType.CrudeOil) { MessageBroker.Default.Publish(new NotificationMessage() { Warning = NotificationType.RefineryFull }); } }
/// <summary> /// Is called when amount of cargo received /// </summary> /// <param name="cargo"></param> private void OnCargoReceived(CargoController cargo) { OilType type = cargo.GetCargoType(); if (type == OilType.CrudeOil) { //2 things happen, store and extract if (storing) { int value = cargo.GetAmount(); //fill if (value != 0) { FillOil(value); } storing = false; } else if (!storing) { int value = cargo.CheckEmpty(); //extract if (value != 0) { ExtractOil(value); } storing = true; } } }
/// <summary> /// Is called when cargo received /// </summary> /// <param name="cargo"></param> private void OnCargoReceived(CargoController cargo) { if (cargo.GetCargoType() == OilType.CrudeOil) { MessageBroker.Default.Publish(new CargoTypeMessage() { Type = OilType.ProcessedOil }); } else if (cargo.GetCargoType() == OilType.ProcessedOil) { MessageBroker.Default.Publish(new CargoTypeMessage() { Type = OilType.CrudeOil }); } }
/// <summary> /// Is called when amount of cargo received /// </summary> /// <param name="cargo"></param> private void OnCargoReceived(CargoController cargo) { int value = cargo.CheckEmpty(); OilType type = cargo.GetCargoType(); if (value != 0 && type == OilType.ProcessedOil) { ExtractOil(value); } else if (type != OilType.ProcessedOil) { MessageBroker.Default.Publish(new NotificationMessage() { Warning = NotificationType.WrongType }); } else if (value == 0 && type == OilType.ProcessedOil) { MessageBroker.Default.Publish(new NotificationMessage() { Warning = NotificationType.CargoFull }); } }
/// <summary> /// Is called when cargo received /// </summary> /// <param name="cargo"></param> private void OnCargoReceived(CargoController cargo) { CheckOrder(cargo.GetCargoType(), cargo.GetAmount()); }