示例#1
0
        private static bool CanStackOnPage(ACDItem item, int stashPageNumber, ref int col, ref int row, InventoryMap itemsOnStashPage)
        {
            if (item.IsUnidentified)
            {
                return(false);
            }

            if (item.MaxStackCount <= 0 ||
                item.GetIsTradeable() ||
                s_specialCaseNonStackableItems.Contains(item.GetRawItemType()))
            {
                return(false);
            }

            for (var i = 0; i < 10; i++)
            {
                for (var c = 0; c < 7; c++)
                {
                    var r = stashPageNumber * 10 + i;

                    if (TryGetStackLocation(item, stashPageNumber, c, r, itemsOnStashPage, ref col, ref row))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        public void DumpInitialPacket(Dictionary<uint, DataElement> data)
        {
            var dataMap = new DataMap(data);

            uint index;
            if (dataMap.TryGetIndex(DataCategory.Radio, out index))
            {
                var radioStations = ReadListOfAttributeMaps(data, index);
                PrintAttributeMaps(radioStations);
            }

            if (dataMap.TryGetIndex(DataCategory.Perks, out index))
            {
                var perks = ReadListOfAttributeMaps(data, index);
                PrintAttributeMaps(perks);
            }

            if (dataMap.TryGetIndex(DataCategory.Stats, out index))
            {
                var stats = ReadListOfAttributes(data, index);
                PrintAttributeMap(stats);
            }

            if (dataMap.TryGetIndex(DataCategory.Special, out index))
            {
                var special = ReadListOfAttributeMaps(data, index);
                PrintAttributeMaps(special);
            }

            if (dataMap.TryGetIndex(DataCategory.Quests, out index))
            {
                var quests = ReadListOfAttributeMaps(data, index);
                PrintAttributeMaps(quests);
            }

            if (dataMap.TryGetIndex(DataCategory.Workshop, out index))
            {
                var workshops = ReadListOfAttributeMaps(data, index);
                PrintAttributeMaps(workshops);
            }

            if (dataMap.TryGetIndex(DataCategory.Log, out index))
            {
                var log = ReadListOfAttributeMaps(data, index);
                PrintAttributeMaps(log);
            }

            if (dataMap.TryGetIndex(DataCategory.Map, out index))
            {
                var map = ReadListOfAttributes(data, index);
                PrintAttributeMap(map);
            }

            if (dataMap.TryGetIndex(DataCategory.PlayerInfo, out index))
            {
                var playerInfo = ReadListOfAttributes(data, index);
                PrintAttributeMap(playerInfo);
            }

            if (dataMap.TryGetIndex(DataCategory.Status, out index))
            {
                var status = ReadListOfAttributes(data, index);
                PrintAttributeMap(status);
            }

            if (dataMap.TryGetIndex(DataCategory.Inventory, out index))
            {
                var inventoryMap = new InventoryMap(data, index);

                if (inventoryMap.TryGetIndex(InventoryCategory.Aid, out index))
                {
                    var aid = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(aid);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Recordings, out index))
                {
                    var recordings = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(recordings);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Weapons, out index))
                {
                    var weapons = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(weapons);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Writings, out index))
                {
                    var books = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(books);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Junk, out index))
                {
                    var junk = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(junk);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Apparel, out index))
                {
                    var apparel = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(apparel);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Keys, out index))
                {
                    var keys = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(keys);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Ammo, out index))
                {
                    var ammo = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(ammo);
                }

                if (inventoryMap.TryGetIndex(InventoryCategory.Components, out index))
                {
                    var components = ReadListOfAttributeMaps(data, index);
                    PrintAttributeMaps(components);
                }
            }
        }
示例#3
0
        private static bool CanPlaceOnPage(ACDItem item, int stashPageNumber, ref int col, ref int row, InventoryMap itemsOnStashPage)
        {
            for (var i = 0; i < 10; i++)
            {
                for (var c = 0; c < 7; c++)
                {
                    var r = stashPageNumber * 10 + i;

                    if (TryGetStashingLocation(item, stashPageNumber, c, r, itemsOnStashPage, ref col, ref row))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }