Ejemplo n.º 1
0
        public static CommonLandSet FromExd(HousingLandSet.LandSet lset, int index)
        {
            var ret = new CommonLandSet();

            ret.LandRange     = lset.LandRange;
            ret.PlacardId     = lset.PlacardId;
            ret.UnknownRange1 = lset.UnknownRange1;
            ret.InitialPrice  = lset.InitialPrice;
            ret.Size          = lset.Size;
            ret.PlotIndex     = index;
            return(ret);
        }
Ejemplo n.º 2
0
        private HousingData(DataManager dataMgr)
        {
            var sheet = dataMgr.GetExcelSheet <HousingLandSet>();

            uint[] terriKeys = { 339, 340, 341, 641, 979 };

            _territoryToLandSetDict = new Dictionary <uint, Dictionary <uint, CommonLandSet> >();

            for (uint i = 0; i < sheet.RowCount; i++)
            {
                if (terriKeys.Length < i)
                {
                    continue;
                }
                var row     = sheet.GetRow(i);
                var rowDict = new Dictionary <uint, CommonLandSet>();
                for (var j = 0; j < row.LandSets.Length; j++)
                {
                    var cset = CommonLandSet.FromExd(row.LandSets[j], j);
                    rowDict[cset.PlacardId] = cset;
                }

                _territoryToLandSetDict[terriKeys[i]] = rowDict;
            }

            var unitedExteriorSheet = dataMgr.GetExcelSheet <HousingUnitedExterior>();

            _unitedDict = new Dictionary <uint, uint>();
            foreach (var row in unitedExteriorSheet)
            {
                foreach (var item in row.Item)
                {
                    _unitedDict[item.Row] = row.RowId;
                }
            }

            _itemDict = dataMgr.GetExcelSheet <Item>()
                        .Where(item => item.AdditionalData != 0 && (item.ItemSearchCategory.Row == 65 || item.ItemSearchCategory.Row == 66))
                        .ToDictionary(row => row.AdditionalData, row => row);

            _stainDict      = dataMgr.GetExcelSheet <Stain>().ToDictionary(row => row.RowId, row => row);
            _furnitureDict  = dataMgr.GetExcelSheet <HousingFurniture>().ToDictionary(row => row.RowId, row => row);
            _yardObjectDict = dataMgr.GetExcelSheet <HousingYardObject>().ToDictionary(row => row.RowId, row => row);

            PluginLog.Log($"Loaded {_territoryToLandSetDict.Keys.Count} landset rows");
            PluginLog.Log($"Loaded {_furnitureDict.Keys.Count} furniture");
            PluginLog.Log($"Loaded {_yardObjectDict.Keys.Count} yard objects");
            PluginLog.Log($"Loaded {_unitedDict.Keys.Count} united parts");
            PluginLog.Log($"Loaded {_stainDict.Keys.Count} stain infos");
            PluginLog.Log($"Loaded {_itemDict.Keys.Count} items with AdditionalData");
        }