Exemple #1
0
        public override string GenerateName(ushort buildingID, InstanceID caller)
        {
            if (this.m_info.m_prefabDataIndex == -1)
            {
                return(null);
            }
            Randomizer randomizer = new Randomizer((int)buildingID);
            string     key        = PrefabCollection <BuildingInfo> .PrefabName((uint)this.m_info.m_prefabDataIndex);

            uint num = Locale.CountUnchecked("BUILDING_NAME", key);

            if (num != 0u)
            {
                return(Locale.Get("BUILDING_NAME", key, randomizer.Int32(num)));
            }
            return(BuildingNameGenerator.GenerateName(this.m_info.m_class.m_subService, randomizer));
        }
        public override void OnLevelLoaded(LoadMode mode)
        {
            if (mode == LoadMode.LoadGame || mode == LoadMode.NewGame)
            {
                BuildingNameGenerator.Initialize();

                Dictionary <Type, Type> componentRemap = new Dictionary <Type, Type> ();
                componentRemap.Add(typeof(CommercialBuildingAI), typeof(CommercialBuildingAIMod));
                componentRemap.Add(typeof(OfficeBuildingAI), typeof(OfficeBuildingAIMod));
                componentRemap.Add(typeof(IndustrialBuildingAI), typeof(IndustrialBuildingAIMod));
                componentRemap.Add(typeof(ResidentialBuildingAI), typeof(ResidentialBuildingAIMod));

                foreach (var pair in componentRemap)
                {
                    redirectStates.Add(NewRedirectState(pair.Key, pair.Value));
                }
            }
        }