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

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

            _workpiece = workpiece;
        }
예제 #3
0
        public virtual bool PlaceResource(Cart cart)
        {
            if (!cart.IsPositionedAt(this))
            {
                return(false);
            }

            Workpiece.Transfer(ref _workpiece, ref cart.LoadedWorkpiece);
            return(true);
        }
예제 #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;
		}
예제 #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;
        }
예제 #6
0
파일: Tool.cs 프로젝트: pascalpfeil/ssharp
 public override bool Apply(Workpiece workpiece) => false;
예제 #7
0
파일: Tool.cs 프로젝트: pascalpfeil/ssharp
 public virtual bool Apply(Workpiece workpiece)
 {
     workpiece.Apply(Capability.ProductionAction);
     return(true);
 }
예제 #8
0
			public override bool Apply(Workpiece workpiece) => false;
예제 #9
0
		public virtual bool Apply(Workpiece workpiece)
		{
			workpiece.Apply(Capability.ProductionAction);
			return true;
		}
예제 #10
0
		public void DiscardWorkpiece()
		{
			_workpiece?.Discard();
			_workpiece = null;
		}
예제 #11
0
		public void ConsumeWorkpiece()
		{
			if (_workpiece == null)
				throw new InvalidOperationException("There is no workpiece located at the robot.");

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

			_workpiece = workpiece;
		}
예제 #13
0
 public void DiscardWorkpiece()
 {
     _workpiece?.Discard();
     _workpiece = null;
 }