Ejemplo n.º 1
0
        public void ConsumeWorkpiece()
        {
            if (_workpiece == null)
            {
                throw new InvalidOperationException("There is no workpiece located at the robot.");
            }

            _workpiece = null;
        }
Ejemplo n.º 2
0
        public void ProduceWorkpiece(Workpiece workpiece)
        {
            if (_workpiece != null)
            {
                throw new InvalidOperationException("There is already a workpiece located at the robot.");
            }

            _workpiece = workpiece;
        }
Ejemplo n.º 3
0
        public virtual bool PlaceResource(Cart cart)
        {
            if (!cart.IsPositionedAt(this))
            {
                return(false);
            }

            Workpiece.Transfer(ref _workpiece, ref cart.LoadedWorkpiece);
            return(true);
        }
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
        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;
        }
Ejemplo n.º 6
0
 public override bool Apply(Workpiece workpiece) => false;
Ejemplo n.º 7
0
 public virtual bool Apply(Workpiece workpiece)
 {
     workpiece.Apply(Capability.ProductionAction);
     return(true);
 }
Ejemplo n.º 8
0
			public override bool Apply(Workpiece workpiece) => false;
Ejemplo n.º 9
0
		public virtual bool Apply(Workpiece workpiece)
		{
			workpiece.Apply(Capability.ProductionAction);
			return true;
		}
Ejemplo n.º 10
0
		public void DiscardWorkpiece()
		{
			_workpiece?.Discard();
			_workpiece = null;
		}
Ejemplo n.º 11
0
		public void ConsumeWorkpiece()
		{
			if (_workpiece == null)
				throw new InvalidOperationException("There is no workpiece located at the robot.");

			_workpiece = null;
		}
Ejemplo n.º 12
0
		public void ProduceWorkpiece(Workpiece workpiece)
		{
			if (_workpiece != null)
				throw new InvalidOperationException("There is already a workpiece located at the robot.");

			_workpiece = workpiece;
		}
Ejemplo n.º 13
0
 public void DiscardWorkpiece()
 {
     _workpiece?.Discard();
     _workpiece = null;
 }