Пример #1
0
        public static bool GiveToSurrounding(this MachineEntity center, ItemBase item)
        {
            bool ignore;
            List <SegmentEntity> list = center.CheckSurrounding <SegmentEntity>(out ignore);

            for (int i = 0; i < list.Count; ++i)
            {
                // Special case - Conveyor belts should only be given items if they're facing away from the machine
                if (list[i] is ConveyorEntity && center.IsConveyorFacingMe(list[i] as ConveyorEntity))
                {
                    continue;
                }
                if (ItemInterop.GiveItem(list[i], item))
                {
                    return(true);
                }
            }
            return(false);
        }