public void ConsumeWorkpiece() { if (_workpiece == null) { throw new InvalidOperationException("There is no workpiece located at the robot."); } _workpiece = null; }
public void ProduceWorkpiece(Workpiece workpiece) { if (_workpiece != null) { throw new InvalidOperationException("There is already a workpiece located at the robot."); } _workpiece = workpiece; }
public virtual bool PlaceResource(Cart cart) { if (!cart.IsPositionedAt(this)) { return(false); } Workpiece.Transfer(ref _workpiece, ref cart.LoadedWorkpiece); return(true); }
public static void Transfer(ref Workpiece origin, ref Workpiece destination) { if (origin == null) throw new InvalidOperationException("There is no workpiece at the origin."); if (destination != null) throw new InvalidOperationException("There already is a workpiece at the destination."); destination = origin; origin = null; }
public static void Transfer(ref Workpiece origin, ref Workpiece destination) { if (origin == null) { throw new InvalidOperationException("There is no workpiece at the origin."); } if (destination != null) { throw new InvalidOperationException("There already is a workpiece at the destination."); } destination = origin; origin = null; }
public override bool Apply(Workpiece workpiece) => false;
public virtual bool Apply(Workpiece workpiece) { workpiece.Apply(Capability.ProductionAction); return(true); }
public virtual bool Apply(Workpiece workpiece) { workpiece.Apply(Capability.ProductionAction); return true; }
public void DiscardWorkpiece() { _workpiece?.Discard(); _workpiece = null; }
public void ConsumeWorkpiece() { if (_workpiece == null) throw new InvalidOperationException("There is no workpiece located at the robot."); _workpiece = null; }
public void ProduceWorkpiece(Workpiece workpiece) { if (_workpiece != null) throw new InvalidOperationException("There is already a workpiece located at the robot."); _workpiece = workpiece; }