Ejemplo n.º 1
0
        public static void outputCountyHistory(FactionsInfo factions)
        {
            string outputDir         = ImportantPaths.getOutputPath() + "\\history\\titles";
            string countyAcquireDate = "767.1.1";

            foreach (FactionInfo faction in factions.getFactions())
            {
                if (!faction.getExists() || faction.getCK2Title() == null)
                {
                    continue;
                }
                HashSet <String> counties = faction.getOwnedCounties();
                foreach (String countyStr in counties)
                {
                    using (StreamWriter writer = File.CreateText(outputDir + "\\" + countyStr + ".txt")) {
                        writer.WriteLine(countyAcquireDate + "={");
                        writer.WriteLine("\tholder=" + faction.getOwner().getID());
                        //if (faction.getOwner().getName() == "Giesmus") {
                        //    int h = 0;
                        //}
                        writer.WriteLine("}");
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void outputFactionTitleHistory(FactionsInfo factions)
        {
            string outputDir        = ImportantPaths.getOutputPath() + "\\history\\titles";
            string titleAcquireDate = "767.1.1";

            foreach (FactionInfo faction in factions.getFactions())
            {
                if (!faction.getExists() || faction.getCK2Title() == null)
                {
                    continue;
                }
                string ck2Title    = faction.getCK2Title();
                int    ownerCharID = faction.getOwner().getID();
                using (StreamWriter writer = File.CreateText(outputDir + "\\" + ck2Title + ".txt")) {
                    writer.WriteLine(titleAcquireDate + "={");
                    writer.WriteLine("\tholder=" + ownerCharID);
                    if (faction.getCK2Title().StartsWith("e_"))
                    {
                        writer.WriteLine("\tlaw=imperial_administration");
                        writer.WriteLine("\tlaw=succ_primogeniture");
                    }
                    if (!faction.getIsNewTitle())
                    {
                        string idName = ("correction_" + faction.getCK2Title()).ToUpper();
                        string idAdj  = ("correction_" + faction.getCK2Title() + "_adj").ToUpper();
                        writer.WriteLine("name=" + idName);
                        writer.WriteLine("adjective=" + idAdj);
                    }
                    writer.WriteLine("}");
                }
            }
        }
Ejemplo n.º 3
0
        public static void output(FactionsInfo factionsObj)
        {
            List <CK2Character> owners   = factionsObj.getOwners();
            List <FactionInfo>  factions = factionsObj.getFactions();
            Dictionary <string, HashSet <CK2Character> > charactersToOutput = new Dictionary <string, HashSet <CK2Character> >();

            foreach (FactionInfo faction in factions)
            {
                if (!faction.getExists())
                {
                    continue;
                }
                CK2Character  owner             = faction.getOwner();
                HashSet <int> writtenCharacters = new HashSet <int>();
                selectCharacter(writtenCharacters, owner, charactersToOutput);
            }
            foreach (var pair in charactersToOutput)
            {
                string filename = ImportantPaths.getOutputPath() + "\\history\\characters\\" + pair.Key + ".txt";
                HashSet <CK2Character> characters = pair.Value;
                using (StreamWriter writer = File.CreateText(filename)) {
                    foreach (CK2Character character in characters)
                    {
                        writeCharacter(writer, character);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public static void output(FactionsInfo factions)
        {
            string           outputPath = ImportantPaths.getOutputPath() + "\\common\\landed_titles\\newTitles.txt";
            HashSet <string> dupChecker = new HashSet <string>();

            using (StreamWriter writer = File.CreateText(outputPath)) {
                foreach (FactionInfo faction in factions.getFactions())
                {
                    if (!faction.getExists())
                    {
                        continue;
                    }
                    writeTitleInfo(writer, faction, dupChecker);
                }
                foreach (FactionInfo faction in factions.getFactions())
                {
                    if (faction.getExists())
                    {
                        continue;
                    }
                    writeTitleInfo(writer, faction, dupChecker);
                }
            }
        }
Ejemplo n.º 5
0
        public static void output(FactionsInfo factionsInfo)
        {
            string outputFile = ImportantPaths.getOutputPath() + "\\localisation\\newTitles.csv";

            using (StreamWriter writer = File.CreateText(outputFile)) {
                writer.WriteLine(LocalisationFormatter.header());
                foreach (FactionInfo faction in factionsInfo.getFactions())
                {
                    if (faction.getCK2Title() == null)
                    {
                        continue;
                    }
                    outputNames(writer, faction);
                    outputAdjectives(writer, faction);
                }
            }
        }
Ejemplo n.º 6
0
        public static void move(FactionsInfo factions)
        {
            string searchDir = ImportantPaths.conversionInfoPath() + "\\factions\\flags";
            string destDir   = ImportantPaths.getOutputPath() + "\\gfx\\flags";

            foreach (FactionInfo faction in factions.getFactions())
            {
                string ck2Title = faction.getCK2Title();
                if (ck2Title == null)
                {
                    continue;
                }
                string target = ck2Title.Substring(2) + ".tga";
                target = searchDir + "\\" + target;
                bool flagExists = File.Exists(target);
                if (!flagExists)
                {
                    continue;
                }
                string dest = destDir + "\\" + ck2Title + ".tga";
                File.Copy(target, dest, true);
            }
        }