public void ValueChange_Block(ModifierDetailRootType_Mix rootType, uint instanceID, int blockID, float num, bool CoverData = false) { if (num == 0 && !CoverData) { return; } if (detailDic.ContainsKey(rootType)) { if (CoverData) { detailDic[rootType].value = num; } else { detailDic[rootType].value += num; } if (detailDic[rootType].value == 0) { //Remove detailDic.Remove(rootType); } } else { ModifierDetailItem_Mix item = new ModifierDetailItem_Mix(rootType, ModifierPackType.Block, instanceID, blockID, num); detailDic.Add(rootType, item); } }
public bool CreateBaseInfo(Vector3 blockPos, FunctionBlock blockBase, FunctionBlockModifier modifier) { BlockID = blockBase.FunctionBlockID; block = blockBase; blockType = FunctionBlockModule.GetFunctionBlockType(BlockID); dataModel = new FunctionBlockDataModel(); dataModel.Create(BlockID); BlockPos = blockPos; blockModifier = modifier; modifierRootType = FunctionBlockModule.FetchBlockModifierRootType(blockType); districtUnlockDataList = FunctionBlockModule.GetBlockDistrictUnlockData(blockBase.FunctionBlockID); levelInfo = new FunctionBlockLevelInfo(blockBase); //District //Set active district build for (int i = 0; i < districtUnlockDataList.Count; i++) { if (districtUnlockDataList[i].UnlockDefault == true) { ActiveDistrictBuildList.Add(DistrictModule.GetDistrictDataByKey(districtUnlockDataList[i].DistrictID)); } } //TODO return(true); }
public ModifierDetailItem_Mix(ModifierDetailRootType_Mix rootType, ModifierPackType packType, uint uid, int typeID, float value) { this.blockType = rootType; this.uid = uid; this.typeID = typeID; this.value = value; }
public void ValueChange_Assemble(ModifierDetailRootType_Mix rootType, ushort UID, int partID, float num, bool CoverData = false) { if (num == 0 && !CoverData) { return; } if (detailDic.ContainsKey(rootType)) { if (CoverData) { detailDic[rootType].value = num; } else { detailDic[rootType].value += num; } if (detailDic[rootType].value == 0) { //Remove detailDic.Remove(rootType); } } else { ModifierDetailItem_Mix item = new ModifierDetailItem_Mix(rootType, ModifierPackType.Assemble, UID, partID, num); detailDic.Add(rootType, item); } }
public static ModifierDetailRootType_Mix FetchBlockModifierRootType(FunctionBlockType type) { ModifierDetailRootType_Mix result = ModifierDetailRootType_Mix.None; if (!Enum.TryParse <ModifierDetailRootType_Mix>(type.ToString(), out result)) { DebugPlus.LogError("[ModifierDetailRootType_Block] fetchType Error! type= " + type); } return(result); }
public static ModifierDetailRootType_Mix FetchAssemblePartModifieRootType(string TypeID) { ModifierDetailRootType_Mix type = ModifierDetailRootType_Mix.None; Enum.TryParse <ModifierDetailRootType_Mix>(TypeID, out type); if (type == ModifierDetailRootType_Mix.None) { DebugPlus.LogError(" FetchAssemblePartModifieRootType Error! typeID=" + TypeID); } return(type); }
public bool InitData(int partID) { this.partID = partID; _partsMeta = AssembleModule.GetAssemblePartDataByKey(partID); if (_partsMeta != null) { baseTimeCost = _partsMeta.BaseTimeCost; materialCostItem = AssembleModule.GetPartMaterialCost(partID); partsConfig = AssembleModule.GetPartsCustomConfigData(partID); partEquipType = AssembleModule.GetAssemblePartEquipType(partID); typePresetData = new AssemblePartTypePresetData(_partsMeta.ModelTypeID); modifierRootType = AssembleModule.FetchAssemblePartModifieRootType(typePresetData.TypeID); return(true); } return(false); }
public ModifierDetailItem_Mix(ModifierDetailRootType_Mix rootType, ModifierPackType packType, float value) { this.packType = packType; this.blockType = rootType; this.value = value; }