/// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        private int[] getArray(BuildingInfo item, int level)
        {
            int[][] array = DataStore.office;

            try
            {
                switch (item.m_class.m_subService)
                {
                case ItemClass.SubService.OfficeHightech:
                    array = DataStore.officeHighTech;
                    break;

                case ItemClass.SubService.OfficeGeneric:
                default:
                    break;
                }

                return(array[level]);
            }
            catch (System.Exception)
            {
                string error = item.gameObject.name + " attempted to be use " + item.m_class.m_subService.ToString() + " with level " + level + ". Returning as level 0.";
                Debugging.writeDebugToFile(error);
                return(array[0]);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        private int[] GetArray(BuildingInfo item, int level)
        {
            int[][] array = DataStore.residentialLow;

            try
            {
                switch (item.m_class.m_subService)
                {
                case ItemClass.SubService.ResidentialHighEco:
                    array = DataStore.resEcoHigh;
                    break;

                case ItemClass.SubService.ResidentialLowEco:
                    array = DataStore.resEcoLow;
                    break;

                case ItemClass.SubService.ResidentialHigh:
                    array = DataStore.residentialHigh;
                    break;

                case ItemClass.SubService.ResidentialLow:
                default:
                    break;
                }

                return(array[level]);
            }
            catch (System.Exception)
            {
                string error = item.gameObject.name + " attempted to be use " + item.m_class.m_subService.ToString() + " with level " + level + ". Returning as level 0.";
                Debugging.writeDebugToFile(error);
                return(array[0]);
            }
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        /// <param name="level"></param>
        /// <returns></returns>
        private int[] getArray(BuildingInfo item, int level)
        {
            int tempLevel = 0;

            int[][] array = DataStore.industry;

            try
            {
                switch (item.m_class.m_subService)
                {
                case ItemClass.SubService.IndustrialOre:
                    array     = DataStore.industry_ore;
                    tempLevel = level + 1;
                    break;

                case ItemClass.SubService.IndustrialForestry:
                    array     = DataStore.industry_forest;
                    tempLevel = level + 1;
                    break;

                case ItemClass.SubService.IndustrialFarming:
                    array     = DataStore.industry_farm;
                    tempLevel = level + 1;
                    break;

                case ItemClass.SubService.IndustrialOil:
                    array     = DataStore.industry_oil;
                    tempLevel = level + 1;
                    break;

                case ItemClass.SubService.IndustrialGeneric:      // Deliberate fall through
                default:
                    tempLevel = level;
                    break;
                }

                return(array[tempLevel]);
            }
            catch (System.Exception)
            {
                string error = item.gameObject.name + " attempted to be use " + item.m_class.m_subService.ToString() + " with level " + level + ". Returning as level 0.";
                Debugging.writeDebugToFile(error);
                return(array[0]);
            }
        }