コード例 #1
0
ファイル: FunctionBlockBase.cs プロジェクト: EpicProj/RPG
        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);
        }
コード例 #2
0
        public List <BuildingPanelData> GetBuildDataByMainType(FunctionBlockType type)
        {
            List <BuildingPanelData> result = new List <BuildingPanelData>();

            for (int i = 0; i < playerData.UnLockBuildingPanelDataList.Count; i++)
            {
                var blockType = FunctionBlockModule.GetFunctionBlockType(playerData.UnLockBuildingPanelDataList[i].FunctionBlockID);
                if (blockType == type)
                {
                    result.Add(playerData.UnLockBuildingPanelDataList[i]);
                }
            }
            return(result);
        }
コード例 #3
0
        public List <BaseDataModel> GetBuildPanelModelData(FunctionBlockType type)
        {
            List <BaseDataModel> result = new List <BaseDataModel>();

            for (int i = 0; i < playerData.UnLockBuildingPanelDataList.Count; i++)
            {
                if (FunctionBlockModule.GetFunctionBlockType(playerData.UnLockBuildingPanelDataList[i].FunctionBlockID) == type)
                {
                    BuildPanelModel model = new BuildPanelModel();
                    if (model.Create(playerData.UnLockBuildingPanelDataList[i].BuildID))
                    {
                        result.Add(model);
                    }
                }
            }
            return(result);
        }