Пример #1
0
 public static int ParseBuildingProperty(this Config.missionCell missionCell)
 {
     if (missionCell == null)
     {
         return(0);
     }
     if (missionCell.ParseTaskType() == TaskType.ParkingLevelup)
     {
         return((int)missionCell.ParseParkingProperty());
     }
     if (missionCell.ParseTaskType() == TaskType.LittleZooLevelup)
     {
         return((int)missionCell.ParseLittleZooProperty());
     }
     if (missionCell.ParseTaskType() == TaskType.EntryGateLevelup)
     {
         return((int)missionCell.ParseEntryGateProperty());
     }
     return(0);
 }
Пример #2
0
        /// <summary>
        /// 根据用户数据获取任务进度
        /// </summary>
        /// <param name="taskId"></param>
        /// <returns></returns>
        public int ResolveTaskProgress(int taskId)
        {
            Config.missionCell missionCell = GetTaskCell(taskId);
            if (missionCell == null)
            {
                return(0);
            }
            TaskType taskType = missionCell.ParseTaskType();

            if (taskType == TaskType.AdWatch || taskType == TaskType.LittleZooVisit)
            {
                return(0);
            }

            if (taskType == TaskType.LittleZooLevelup)
            {
                int litzooId = missionCell.GetLittleZooId();
                LittleZooModuleDataMSS litzooData = null;
                try { litzooData = playerData.GetLittleZooModuleData(litzooId); }
                catch (Exception e) { string.Format("动物栏[{0}]还未开启", litzooId); }

                if (litzooData != null)
                {
                    LittleZooProperty zooProp = missionCell.ParseLittleZooProperty();
                    if (zooProp == LittleZooProperty.TicketPrice)
                    {
                        return(litzooData.littleZooTicketsLevel);
                    }
                    else if (zooProp == LittleZooProperty.Capacity)
                    {
                        return(litzooData.littleZooVisitorSeatLevel);
                    }
                    else if (zooProp == LittleZooProperty.VisitSpeed)
                    {
                        return(litzooData.littleZooEnterVisitorSpawnLevel);
                    }
                }
                return(0);
            }
            else if (taskType == TaskType.ParkingLevelup)
            {
                ParkingProperty parkProp = missionCell.ParseParkingProperty();
                if (parkProp == ParkingProperty.Revenue)
                {
                    return(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingProfitLevel);
                }
                else if (parkProp == ParkingProperty.Capacity)
                {
                    return(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingSpaceLevel);
                }
                else if (parkProp == ParkingProperty.VisitorFlowSpeed)
                {
                    return(playerData.GetParkingCenterDataIDIndexOfDataIdx().parkingEnterCarSpawnLevel);
                }
            }
            else if (taskType == TaskType.EntryGateLevelup)
            {
                EntryGateProperty entryProp = missionCell.ParseEntryGateProperty();
                if (entryProp == EntryGateProperty.TicketPrice)
                {
                    return(playerData.GetEntryDateDataIDIndexOfDataIdx().entryTicketsLevel);
                }
                else if (entryProp == EntryGateProperty.Entrance)
                {
                    GateData entryData = null;
                    int      entryId   = missionCell.GetEntryGateId();
                    try { entryData = playerData.GetEntryGateIDIndexOfDataIdx(entryId); }
                    catch (Exception e) { string.Format("售票口[{0}]还未开启", entryId); }

                    return(entryData != null ? entryData.level : 0);
                }
            }
            return(0);
        }