Beispiel #1
0
        public static ItemLocation FromItemLocation(ItemLocation location)
        {
            switch (location.Type)
            {
            case Constants.ItemLocationType.Container:
                return(ItemLocation.FromContainer(location.ContainerId, location.ContainerSlot));

            case Constants.ItemLocationType.Ground:
                return(ItemLocation.FromLocation(location.GroundLocation, location.StackOrder));

            /*case Constants.ItemLocationType.Slot:
             *  return ItemLocation.FromSlot(location.Slot);*/
            default:
                return(null);
            }
        }
Beispiel #2
0
        public IEnumerable <Item> GetItems()
        {
            byte slot = 0;

            int numItems = Memory.ReadInt((int)address + Addresses.Container.DistanceAmount);

            for (uint i = 0; i < numItems; i++)
            {
                int itemId = Memory.ReadInt(address + (i * Addresses.Container.StepSlot) + Addresses.Container.DistanceItemId);
                if (itemId > 0)
                {
                    yield return(new Item((uint)itemId, Memory.ReadByte(address + (i * Addresses.Container.StepSlot) + Addresses.Container.DistanceItemCount), ItemLocation.FromContainer(number, slot)));
                }
                slot++;
            }
        }