Beispiel #1
0
        public static Dictionary <int, Slot> GetEmptyOrFoodSlots(CraftersConsignmentDisplay display, out DisplayTypes displayType)
        {
            Dictionary <int, Slot> slots = new Dictionary <int, Slot>();

            Slot[] displaySlots = display.GetContainmentSlots();
            for (int i = 0; i < displaySlots.Length; i++)
            {
                if (i > 25 && displaySlots[i].ToString() == "TransformBone")
                {
                    break;
                }

                GameObject containedObject = display.GetContainedObject(displaySlots[i]) as GameObject;

                if (containedObject is FailureObject)
                {
                    try
                    {
                        containedObject.Destroy();
                    }
                    catch { }
                }

                if (containedObject is IFoodContainer || containedObject is ServingContainer || containedObject == null)
                {
                    slots.Add(i, displaySlots[i]);
                }
            }

            displayType = GetDisplayType(display);

            return(slots);
        }
Beispiel #2
0
        public static Dictionary<int, Slot> GetEmptyOrFoodSlots(CraftersConsignmentDisplay display, out DisplayTypes displayType)
        {
            Dictionary<int, Slot> slots = new Dictionary<int, Slot>();
            
            Slot[] displaySlots = display.GetContainmentSlots();
            for (int i = 0; i < displaySlots.Length; i++)
            {
                if (i > 25 && displaySlots[i].ToString() == "TransformBone")
                {
                    break;
                }

                GameObject containedObject = display.GetContainedObject(displaySlots[i]) as GameObject;

                if (containedObject is FailureObject)
                {
                    try
                    {
                        containedObject.Destroy();
                    }
                    catch { }
                }

                if (containedObject is IFoodContainer || containedObject is ServingContainer || containedObject == null)
                {
                    slots.Add(i, displaySlots[i]);                    
                }
            }

            displayType = GetDisplayType(display);            

            return slots;
        }
Beispiel #3
0
        public static DisplayTypes GetDisplayType(CraftersConsignmentDisplay display)
        {
            Slot[] displaySlots = display.GetContainmentSlots();

            DisplayTypes displayType;
            // Yay to brappl for helping me nail this one
            int length = displaySlots.Length - 1;

            if (displaySlots[length].ToString() != "TransformBone")
            {
                if (displaySlots.Length == 26)
                {
                    displayType = DisplayTypes.Chiller;
                }
                else
                {
                    displayType = DisplayTypes.Rack;
                }
            }
            else
            {
                if (displaySlots.Length == 27)
                {
                    displayType = DisplayTypes.Chiller;
                }
                else
                {
                    displayType = DisplayTypes.Rack;
                }
            }

            return(displayType);
        }
Beispiel #4
0
        public static DisplayTypes GetDisplayType(CraftersConsignmentDisplay display)
        {
            Slot[] displaySlots = display.GetContainmentSlots();

            DisplayTypes displayType;
            // Yay to brappl for helping me nail this one
            int length = displaySlots.Length - 1;
            if (displaySlots[length].ToString() != "TransformBone")
            {
                if (displaySlots.Length == 26)
                {
                    displayType = DisplayTypes.Chiller;
                }
                else
                {
                    displayType = DisplayTypes.Rack;
                }
            }
            else
            {
                if (displaySlots.Length == 27)
                {
                    displayType = DisplayTypes.Chiller;
                }
                else
                {
                    displayType = DisplayTypes.Rack;
                }
            }

            return displayType;
        }