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

            _workpiece = null;
        }
Esempio 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;
        }
Esempio n. 3
0
        public virtual bool PlaceResource(Cart cart)
        {
            if (!cart.IsPositionedAt(this))
            {
                return(false);
            }

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

			_workpiece = null;
		}
Esempio 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;
		}
Esempio n. 13
0
 public void DiscardWorkpiece()
 {
     _workpiece?.Discard();
     _workpiece = null;
 }