static void Main(string[] args) { var markov = new Markov("nameResidential", false, 4); //var markov = new ExtendedBuildings.Markov("ExtendedBuildings.markov.descriptionsWorkplaces.txt", false, 6); Randomizer randomizer = new Randomizer(50); for (var i = 0; i < 100; i += 1) { Console.WriteLine(markov.GetText(ref randomizer, 6, 13, true, true)); } //Console.Write(markov.GetText(120, 220, true)); var x = Console.ReadLine(); if (x == "") { } }
private static void LoadTextFiles() { buildingNames.Clear(); var commercialName = new Markov("nameCommercial", false, 4); buildingNames.Add(ItemClass.Zone.CommercialHigh.ToString(), commercialName); buildingNames.Add(ItemClass.Zone.CommercialLow.ToString(), commercialName); var resName = new Markov("nameResidential", false, 4); buildingNames.Add(ItemClass.Zone.ResidentialHigh.ToString(), resName); buildingNames.Add(ItemClass.Zone.ResidentialLow.ToString(), resName); var indyName = new Markov("nameIndustrial", false, 4); buildingNames.Add(ItemClass.Zone.Industrial.ToString(), indyName); var officeName = new Markov("nameOffice", false, 4); buildingNames.Add(ItemClass.Zone.Office.ToString(), officeName); buildingNames.Add(ItemClass.SubService.IndustrialFarming.ToString(), new Markov("nameFarm", false, 4)); buildingNames.Add(ItemClass.SubService.IndustrialForestry.ToString(), new Markov("nameForest", false, 4)); buildingNames.Add(ItemClass.SubService.IndustrialOre.ToString(), new Markov("nameMine", false, 4)); buildingNames.Add(ItemClass.SubService.IndustrialOil.ToString(), new Markov("nameOil", false, 4)); buildingDescriptions.Clear(); var commercialDescription = new Markov("descriptionsCommercial", false, 9); buildingDescriptions.Add(ItemClass.Zone.CommercialHigh.ToString(), commercialDescription); buildingDescriptions.Add(ItemClass.Zone.CommercialLow.ToString(), commercialDescription); var resDescription = new Markov("descriptionsResidential", false, 9); buildingDescriptions.Add(ItemClass.Zone.ResidentialHigh.ToString(), resDescription); buildingDescriptions.Add(ItemClass.Zone.ResidentialLow.ToString(), resDescription); var indyDescription = new Markov("descriptionsIndustrial", false, 9); buildingDescriptions.Add(ItemClass.Zone.Industrial.ToString(), indyDescription); var officeDescription = new Markov("descriptionsOffice", false, 9); buildingDescriptions.Add(ItemClass.Zone.Office.ToString(), officeDescription); buildingDescriptions.Add(ItemClass.SubService.IndustrialFarming.ToString(), new Markov("descriptionsFarm", false, 4)); buildingDescriptions.Add(ItemClass.SubService.IndustrialForestry.ToString(), new Markov("descriptionsForest", false, 4)); buildingDescriptions.Add(ItemClass.SubService.IndustrialOre.ToString(), new Markov("descriptionsMine", false, 4)); buildingDescriptions.Add(ItemClass.SubService.IndustrialOil.ToString(), new Markov("descriptionsOil", false, 4)); }
private string GetName(ushort buildingId, ItemClass.Zone zone, ItemClass.SubService ss) { Randomizer randomizer = new Randomizer(Singleton <SimulationManager> .instance.m_metaData.m_gameInstanceIdentifier.GetHashCode() - buildingId); if (buildingId % 6 != 0) { Markov markov = null; if (!this.buildingNames.TryGetValue(ss.ToString(), out markov)) { this.buildingNames.TryGetValue(zone.ToString(), out markov); } if (markov != null) { return(markov.GetText(ref randomizer, 6, 16, true, true)); } } return(this.buildingName.text); }
private string GetDescription(string bName, ushort buildingId, ItemClass.Zone zone, ItemClass.SubService ss) { Randomizer randomizer = new Randomizer(Singleton <SimulationManager> .instance.m_metaData.m_gameInstanceIdentifier.GetHashCode() - buildingId); var year = 2015 - buildingId % 200; Markov markov = null; if (!this.buildingDescriptions.TryGetValue(ss.ToString(), out markov)) { this.buildingDescriptions.TryGetValue(zone.ToString(), out markov); } if (markov != null) { var text = markov.GetText(ref randomizer, 100, 200, true); var cityName = Singleton <SimulationManager> .instance.m_metaData.m_CityName.Trim(); text = text.Replace("COMPANY", bName).Replace("DATE", year.ToString()).Replace("SITY", cityName); return(text); } return(""); }
private void LoadTextFiles() { var commercialName = new Markov("nameCommercial", false, 4); buildingNames.Add(ItemClass.Zone.CommercialHigh.ToString(), commercialName); buildingNames.Add(ItemClass.Zone.CommercialLow.ToString(), commercialName); var resName = new Markov("nameResidential", false, 4); buildingNames.Add(ItemClass.Zone.ResidentialHigh.ToString(), resName); buildingNames.Add(ItemClass.Zone.ResidentialLow.ToString(), resName); var indyName = new Markov("nameIndustrial", false, 4); buildingNames.Add(ItemClass.Zone.Industrial.ToString(), indyName); var officeName = new Markov("nameOffice", false, 4); buildingNames.Add(ItemClass.Zone.Office.ToString(), officeName); buildingNames.Add(ItemClass.SubService.IndustrialFarming.ToString(), new Markov("nameFarm", false, 4)); buildingNames.Add(ItemClass.SubService.IndustrialForestry.ToString(), new Markov("nameForest", false, 4)); buildingNames.Add(ItemClass.SubService.IndustrialOre.ToString(), new Markov("nameMine", false, 4)); buildingNames.Add(ItemClass.SubService.IndustrialOil.ToString(), new Markov("nameOil", false, 4)); buildingDescriptions.Clear(); var commercialDescription = new Markov("descriptionsCommercial", false, 9); buildingDescriptions.Add(ItemClass.Zone.CommercialHigh.ToString(), commercialDescription); buildingDescriptions.Add(ItemClass.Zone.CommercialLow.ToString(), commercialDescription); var resDescription = new Markov("descriptionsResidential", false, 9); buildingDescriptions.Add(ItemClass.Zone.ResidentialHigh.ToString(), resDescription); buildingDescriptions.Add(ItemClass.Zone.ResidentialLow.ToString(), resDescription); var indyDescription = new Markov("descriptionsIndustrial", false, 9); buildingDescriptions.Add(ItemClass.Zone.Industrial.ToString(), indyDescription); var officeDescription = new Markov("descriptionsOffice", false, 9); buildingDescriptions.Add(ItemClass.Zone.Office.ToString(), officeDescription); buildingDescriptions.Add(ItemClass.SubService.IndustrialFarming.ToString(), new Markov("descriptionsFarm", false, 4)); buildingDescriptions.Add(ItemClass.SubService.IndustrialForestry.ToString(), new Markov("descriptionsForest", false, 4)); buildingDescriptions.Add(ItemClass.SubService.IndustrialOre.ToString(), new Markov("descriptionsMine", false, 4)); buildingDescriptions.Add(ItemClass.SubService.IndustrialOil.ToString(), new Markov("descriptionsOil", false, 4)); }