Example #1
0
 private void PrintLeaders()
 {
     if (Entity.Leaders != null && Entity.Leaders.Count > 0)
     {
         HTML.AppendLine(Bold("Leaders") + " " + MakeLink("[Load]", LinkOption.LoadEntityLeaders) + LineBreak);
         foreach (string leaderType in Entity.LeaderTypes)
         {
             HTML.AppendLine(leaderType + "s" + LineBreak);
             TableMaker leaderTable = new TableMaker(true);
             foreach (HistoricalFigure leader in Entity.Leaders[Entity.LeaderTypes.IndexOf(leaderType)])
             {
                 leaderTable.StartRow();
                 leaderTable.AddData(leader.Positions.Last(position => position.Title == leaderType).Began.ToString());
                 leaderTable.AddData(leader.ToLink());
                 leaderTable.EndRow();
             }
             HTML.AppendLine(leaderTable.GetTable() + LineBreak);
         }
     }
 }
Example #2
0
 private void PrintLeaders()
 {
     if (Entity.Leaders != null && Entity.Leaders.Count > 0)
     {
         HTML.AppendLine(Bold("Leaders") + " " + MakeLink("[Load]", LinkOption.LoadEntityLeaders) + LineBreak);
         foreach (string leaderType in Entity.LeaderTypes)
         {
             HTML.AppendLine(leaderType + "s" + LineBreak);
             TableMaker leaderTable = new TableMaker(true);
             foreach (HistoricalFigure leader in Entity.Leaders[Entity.LeaderTypes.IndexOf(leaderType)])
             {
                 leaderTable.StartRow();
                 leaderTable.AddData(leader.Positions.Last(position => position.Title == leaderType).Began.ToString());
                 leaderTable.AddData(leader.ToLink());
                 leaderTable.EndRow();
             }
             HTML.AppendLine(leaderTable.GetTable() + LineBreak);
         }
     }
 }
Example #3
0
        private void PrintTitle()
        {
            string title = Entity.ToLink(false);

            if (Entity.IsCiv)
            {
                title += " is a civilization of ";
            }
            else
            {
                title += " is a group of ";
            }
            title += Entity.Race.ToLower();
            if (Entity.Parent != null)
            {
                title += " of " + Entity.Parent.ToLink(true, Entity);
            }
            HTML.AppendLine(Bold(title) + LineBreak + LineBreak);

            if (Entity.IsCiv)
            {
                HTML.AppendLine(Entity.PrintIdenticon(true) + LineBreak + LineBreak);
            }

            if (Entity.SiteHistory.Count > 0)
            {
                if (Entity.SiteHistory.Count(sitePeriod => sitePeriod.EndYear == -1) == 0)
                {
                    HTML.AppendLine(Font("Last Known Sites. Year: " + (Entity.SiteHistory.Max(sitePeriod => sitePeriod.EndYear) - 1), "red"));
                }
                List <Bitmap> maps     = MapPanel.CreateBitmaps(World, Entity);
                TableMaker    mapTable = new TableMaker(false, maps[0].Width + maps[1].Width + 10);
                mapTable.StartRow();
                mapTable.AddData(MakeLink(BitmapToHTML(maps[0]), LinkOption.LoadMap));
                mapTable.AddData(MakeLink(BitmapToHTML(maps[1]), LinkOption.LoadMap));
                mapTable.EndRow();
                HTML.AppendLine(mapTable.GetTable());
                maps[0].Dispose();
                maps[1].Dispose();
            }
        }
Example #4
0
 private void PrintSiteHistory()
 {
     if (Entity.SiteHistory.Count > 0)
     {
         HTML.AppendLine(Bold("Site History") + " " + MakeLink("[Load]", LinkOption.LoadEntitySites) + LineBreak);
         TableMaker siteTable = new TableMaker(true);
         foreach (OwnerPeriod ownedSite in Entity.SiteHistory)
         {
             siteTable.StartRow();
             siteTable.AddData(ownedSite.Owner.ToLink(true, Entity));
             siteTable.AddData(ownedSite.StartCause);
             siteTable.AddData(ownedSite.Site.ToLink());
             siteTable.AddData(ownedSite.StartYear.ToString());
             if (ownedSite.EndYear >= 0)
             {
                 siteTable.AddData(ownedSite.EndCause);
                 siteTable.AddData(ownedSite.EndYear.ToString());
             }
             if (ownedSite.Ender != null)
             {
                 if (ownedSite.Ender is Entity)
                 {
                     siteTable.AddData(" by " + ((Entity)ownedSite.Ender).PrintEntity(), 0, TableDataAlign.Right);
                 }
                 else
                 {
                     siteTable.AddData(" by " + ownedSite.Ender.ToLink(true, Entity), 0, TableDataAlign.Right);
                 }
             }
             siteTable.EndRow();
         }
         HTML.AppendLine(siteTable.GetTable() + LineBreak);
     }
 }
Example #5
0
        private void PrintWars()
        {
            if (Entity.Wars.Count(war => !World.FilterBattles || war.Notable) > 0)
            {
                HTML.AppendLine(Bold("Wars") + " " + MakeLink("[Load]", LinkOption.LoadEntityWars) + LineBreak);
                TableMaker warTable = new TableMaker(true);
                foreach (War war in Entity.Wars.Where(war => !World.FilterBattles || war.Notable))
                {
                    warTable.StartRow();
                    string endString;
                    if (war.EndYear == -1) endString = "Present";
                    else endString = war.EndYear.ToString();

                    warTable.AddData(war.StartYear + " - " + endString);
                    warTable.AddData(war.ToLink());

                    if (war.Attacker == Entity)
                    {
                        warTable.AddData("waged against");
                        warTable.AddData(war.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("");
                    }
                    else if (war.Attacker.Parent == Entity)
                    {
                        warTable.AddData("waged against");
                        warTable.AddData(war.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("by " + war.Attacker.ToLink());
                    }
                    else if (war.Defender == Entity)
                    {
                        warTable.AddData("defended against");
                        warTable.AddData(war.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("");
                    }
                    else if (war.Defender.Parent == Entity)
                    {
                        warTable.AddData("defended against");
                        warTable.AddData(war.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("by " + war.Defender.ToLink());
                    }

                    int battleVictories = 0, battleLossses = 0, sitesDestroyed = 0, sitesLost = 0, kills, losses;
                    if (war.Attacker == Entity || war.Attacker.Parent == Entity)
                    {
                        battleVictories = war.AttackerVictories.OfType<Battle>().Count();
                        battleLossses = war.DefenderVictories.OfType<Battle>().Count();
                        sitesDestroyed = war.AttackerVictories.OfType<SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                        sitesLost = war.DefenderVictories.OfType<SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                    }
                    else if (war.Defender == Entity || war.Defender.Parent == Entity)
                    {
                        battleVictories = war.DefenderVictories.OfType<Battle>().Count();
                        battleLossses = war.AttackerVictories.OfType<Battle>().Count();
                        sitesDestroyed = war.DefenderVictories.OfType<SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                        sitesLost = war.AttackerVictories.OfType<SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                    }

                    kills = war.Collections.OfType<Battle>().Where(battle => battle.Attacker == Entity || battle.Attacker.Parent == Entity).Sum(battle => battle.DefenderDeathCount) + war.Collections.OfType<Battle>().Where(battle => battle.Defender == Entity || battle.Defender.Parent == Entity).Sum(battle => battle.AttackerDeathCount);
                    losses = war.Collections.OfType<Battle>().Where(battle => battle.Attacker == Entity || battle.Attacker.Parent == Entity).Sum(battle => battle.AttackerDeathCount) + war.Collections.OfType<Battle>().Where(battle => battle.Defender == Entity || battle.Defender.Parent == Entity).Sum(battle => battle.DefenderDeathCount);

                    warTable.AddData("(V/L)");
                    warTable.AddData("Battles:");
                    warTable.AddData(battleVictories.ToString(), 0, TableDataAlign.Right);
                    warTable.AddData("/");
                    warTable.AddData(battleLossses.ToString());
                    warTable.AddData("Sites:");
                    warTable.AddData(sitesDestroyed.ToString(), 0, TableDataAlign.Right);
                    warTable.AddData("/");
                    warTable.AddData(sitesLost.ToString());
                    warTable.AddData("Deaths:");
                    warTable.AddData(kills.ToString(), 0, TableDataAlign.Right);
                    warTable.AddData("/");
                    warTable.AddData(losses.ToString());
                    warTable.EndRow();
                }
                HTML.AppendLine(warTable.GetTable() + LineBreak);

            }
        }
Example #6
0
        private void PrintTitle()
        {
            string title = Entity.ToLink(false);
            if (Entity.IsCiv) title += " is a civilization of ";
            else title += " is a group of ";
            title += Entity.Race.ToLower();
            if (Entity.Parent != null) title += " of " + Entity.Parent.ToLink(true, Entity);
            HTML.AppendLine(Bold(title) + LineBreak + LineBreak);

            if (Entity.IsCiv)
                HTML.AppendLine(Entity.PrintIdenticon(true) + LineBreak + LineBreak);

            if (Entity.SiteHistory.Count > 0)
            {
                if (Entity.SiteHistory.Count(sitePeriod => sitePeriod.EndYear == -1) == 0)
                    HTML.AppendLine(Font("Last Known Sites. Year: " + (Entity.SiteHistory.Max(sitePeriod => sitePeriod.EndYear) - 1), "red"));
                List<Bitmap> maps = MapPanel.CreateBitmaps(World, Entity);
                TableMaker mapTable = new TableMaker(false, maps[0].Width + maps[1].Width + 10);
                mapTable.StartRow();
                mapTable.AddData(MakeLink(BitmapToHTML(maps[0]), LinkOption.LoadMap));
                mapTable.AddData(MakeLink(BitmapToHTML(maps[1]), LinkOption.LoadMap));
                mapTable.EndRow();
                HTML.AppendLine(mapTable.GetTable());
                maps[0].Dispose();
                maps[1].Dispose();
            }
        }
Example #7
0
        private void PrintBattles()
        {
            Battle unnotableDeathBattle = null; //Temporarily make the battle that the HF died in Notable so it shows up.

            if (HistoricalFigure.Battles.Count > 0 && HistoricalFigure.Battles.Last().Collection.OfType <HFDied>().Count(death => death.HistoricalFigure == HistoricalFigure) == 1 && !HistoricalFigure.Battles.Last().Notable)
            {
                unnotableDeathBattle         = HistoricalFigure.Battles.Last();
                unnotableDeathBattle.Notable = true;
            }

            if (HistoricalFigure.Battles.Count(battle => !World.FilterBattles || battle.Notable) > 0)
            {
                HTML.AppendLine(Bold("Battles") + MakeLink("[Load]", LinkOption.LoadHFBattles));
                if (World.FilterBattles)
                {
                    HTML.Append(" (Notable)");
                }
                HTML.Append(LineBreak);
                TableMaker battleTable = new TableMaker(true);
                foreach (Battle battle in HistoricalFigure.Battles.Where(battle => (!World.FilterBattles || battle.Notable) || battle.Collection.OfType <HFDied>().Count(death => death.HistoricalFigure == HistoricalFigure) > 0))
                {
                    battleTable.StartRow();
                    battleTable.AddData(battle.StartYear.ToString());
                    battleTable.AddData(battle.ToLink());
                    if (battle.ParentCollection != null)
                    {
                        battleTable.AddData("as part of");
                        battleTable.AddData(battle.ParentCollection.ToLink());
                    }
                    string involvement = "";
                    if (battle.NotableAttackers.Count > 0 && battle.NotableAttackers.Contains(HistoricalFigure))
                    {
                        if (battle.Collection.OfType <FieldBattle>().Any(fieldBattle => fieldBattle.AttackerGeneral == HistoricalFigure) ||
                            battle.Collection.OfType <AttackedSite>().Any(attack => attack.AttackerGeneral == HistoricalFigure))
                        {
                            involvement += "Led the attack";
                        }
                        else
                        {
                            involvement += "Fought in the attack";
                        }
                    }
                    else if (battle.NotableDefenders.Count > 0 && battle.NotableDefenders.Contains(HistoricalFigure))
                    {
                        if (battle.Collection.OfType <FieldBattle>().Any(fieldBattle => fieldBattle.DefenderGeneral == HistoricalFigure) ||
                            battle.Collection.OfType <AttackedSite>().Any(attack => attack.DefenderGeneral == HistoricalFigure))
                        {
                            involvement += "Led the defense";
                        }
                        else
                        {
                            involvement += "Aided in the defense";
                        }
                    }
                    else
                    {
                        involvement += "A non combatant";
                    }

                    if (battle.GetSubEvents().OfType <HFDied>().Any(death => death.HistoricalFigure == HistoricalFigure))
                    {
                        involvement += " and died";
                    }
                    battleTable.AddData(involvement);
                    if (battle.NotableAttackers.Contains(HistoricalFigure))
                    {
                        battleTable.AddData("against");
                        battleTable.AddData(battle.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        if (battle.Victor == battle.Attacker)
                        {
                            battleTable.AddData("and won");
                        }
                        else
                        {
                            battleTable.AddData("and lost");
                        }
                    }
                    else if (battle.NotableDefenders.Contains(HistoricalFigure))
                    {
                        battleTable.AddData("against");
                        battleTable.AddData(battle.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        if (battle.Victor == battle.Defender)
                        {
                            battleTable.AddData("and won");
                        }
                        else
                        {
                            battleTable.AddData("and lost");
                        }
                    }

                    battleTable.AddData("Deaths: " + (battle.AttackerDeathCount + battle.DefenderDeathCount) + ")");

                    battleTable.EndRow();
                }
                HTML.AppendLine(battleTable.GetTable() + LineBreak);
            }

            if (World.FilterBattles && HistoricalFigure.Battles.Count(battle => !battle.Notable) > 0)
            {
                HTML.AppendLine(Bold("Battles") + " (Unnotable): " + HistoricalFigure.Battles.Where(battle => !battle.Notable).Count() + LineBreak + LineBreak);
            }

            if (unnotableDeathBattle != null)
            {
                unnotableDeathBattle.Notable = false;
            }
        }
        private void PrintBattles()
        {
            Battle unnotableDeathBattle = null; //Temporarily make the battle that the HF died in Notable so it shows up.
            if (HistoricalFigure.Battles.Count > 0 && HistoricalFigure.Battles.Last().Collection.OfType<HFDied>().Count(death => death.HistoricalFigure == HistoricalFigure) == 1 && !HistoricalFigure.Battles.Last().Notable)
            {
                unnotableDeathBattle = HistoricalFigure.Battles.Last();
                unnotableDeathBattle.Notable = true;
            }

            if (HistoricalFigure.Battles.Count(battle => !World.FilterBattles || battle.Notable) > 0)
            {
                HTML.AppendLine(Bold("Battles") + MakeLink("[Load]", LinkOption.LoadHFBattles));
                if (World.FilterBattles)
                    HTML.Append(" (Notable)");
                HTML.Append(LineBreak);
                TableMaker battleTable = new TableMaker(true);
                foreach (Battle battle in HistoricalFigure.Battles.Where(battle => (!World.FilterBattles || battle.Notable) || battle.Collection.OfType<HFDied>().Count(death => death.HistoricalFigure == HistoricalFigure) > 0))
                {
                    battleTable.StartRow();
                    battleTable.AddData(battle.StartYear.ToString());
                    battleTable.AddData(battle.ToLink());
                    battleTable.AddData("as part of");
                    battleTable.AddData(battle.ParentCollection.ToLink());
                    string involvement = "";
                    if (battle.NotableAttackers.Count > 0 && battle.NotableAttackers.Contains(HistoricalFigure))
                        if (battle.Collection.OfType<FieldBattle>().Where(fieldBattle => fieldBattle.AttackerGeneral == HistoricalFigure).Count() > 0 ||
                            battle.Collection.OfType<AttackedSite>().Where(attack => attack.AttackerGeneral == HistoricalFigure).Count() > 0)
                            involvement += "Led the attack";
                        else
                            involvement += "Fought in the attack";
                    else if (battle.NotableDefenders.Count > 0 && battle.NotableDefenders.Contains(HistoricalFigure))
                        if (battle.Collection.OfType<FieldBattle>().Where(fieldBattle => fieldBattle.DefenderGeneral == HistoricalFigure).Count() > 0 ||
                            battle.Collection.OfType<AttackedSite>().Where(attack => attack.DefenderGeneral == HistoricalFigure).Count() > 0)
                            involvement += "Led the defense";
                        else
                            involvement += "Aided in the defense";
                    else
                        involvement += "A non combatant";

                    if (battle.GetSubEvents().OfType<HFDied>().Where(death => death.HistoricalFigure == HistoricalFigure).Count() > 0)
                        involvement += " and died";
                    battleTable.AddData(involvement);
                    if (battle.NotableAttackers.Contains(HistoricalFigure))
                    {
                        battleTable.AddData("against");
                        battleTable.AddData(battle.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        if (battle.Victor == battle.Attacker)
                            battleTable.AddData("and won");
                        else
                            battleTable.AddData("and lost");
                    }
                    else if (battle.NotableDefenders.Contains(HistoricalFigure))
                    {
                        battleTable.AddData("against");
                        battleTable.AddData(battle.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        if (battle.Victor == battle.Defender)
                            battleTable.AddData("and won");
                        else
                            battleTable.AddData("and lost");
                    }

                    battleTable.AddData("Deaths: " + (battle.AttackerDeathCount + battle.DefenderDeathCount) + ")");

                    battleTable.EndRow();
                }
                HTML.AppendLine(battleTable.GetTable() + LineBreak);
            }

            if (World.FilterBattles && HistoricalFigure.Battles.Count(battle => !battle.Notable) > 0)
                HTML.AppendLine(Bold("Battles") + " (Unnotable): " + HistoricalFigure.Battles.Where(battle => !battle.Notable).Count() + LineBreak + LineBreak);

            if (unnotableDeathBattle != null)
                unnotableDeathBattle.Notable = false;
        }
Example #9
0
        private void PrintWars()
        {
            if (Entity.Wars.Count(war => !World.FilterBattles || war.Notable) > 0)
            {
                HTML.AppendLine(Bold("Wars") + " " + MakeLink("[Load]", LinkOption.LoadEntityWars) + LineBreak);
                TableMaker warTable = new TableMaker(true);
                foreach (War war in Entity.Wars.Where(war => !World.FilterBattles || war.Notable))
                {
                    warTable.StartRow();
                    string endString;
                    if (war.EndYear == -1)
                    {
                        endString = "Present";
                    }
                    else
                    {
                        endString = war.EndYear.ToString();
                    }

                    warTable.AddData(war.StartYear + " - " + endString);
                    warTable.AddData(war.ToLink());

                    if (war.Attacker == Entity)
                    {
                        warTable.AddData("waged against");
                        warTable.AddData(war.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("");
                    }
                    else if (war.Attacker.Parent == Entity)
                    {
                        warTable.AddData("waged against");
                        warTable.AddData(war.Defender.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("by " + war.Attacker.ToLink());
                    }
                    else if (war.Defender == Entity)
                    {
                        warTable.AddData("defended against");
                        warTable.AddData(war.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("");
                    }
                    else if (war.Defender.Parent == Entity)
                    {
                        warTable.AddData("defended against");
                        warTable.AddData(war.Attacker.PrintEntity(), 0, TableDataAlign.Right);
                        warTable.AddData("by " + war.Defender.ToLink());
                    }

                    int battleVictories = 0, battleLossses = 0, sitesDestroyed = 0, sitesLost = 0, kills, losses;
                    if (war.Attacker == Entity || war.Attacker.Parent == Entity)
                    {
                        battleVictories = war.AttackerVictories.OfType <Battle>().Count();
                        battleLossses   = war.DefenderVictories.OfType <Battle>().Count();
                        sitesDestroyed  = war.AttackerVictories.OfType <SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                        sitesLost       = war.DefenderVictories.OfType <SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                    }
                    else if (war.Defender == Entity || war.Defender.Parent == Entity)
                    {
                        battleVictories = war.DefenderVictories.OfType <Battle>().Count();
                        battleLossses   = war.AttackerVictories.OfType <Battle>().Count();
                        sitesDestroyed  = war.DefenderVictories.OfType <SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                        sitesLost       = war.AttackerVictories.OfType <SiteConquered>().Count(conquering => conquering.ConquerType != SiteConqueredType.Pillaging);
                    }

                    kills  = war.Collections.OfType <Battle>().Where(battle => battle.Attacker == Entity || battle.Attacker.Parent == Entity).Sum(battle => battle.DefenderDeathCount) + war.Collections.OfType <Battle>().Where(battle => battle.Defender == Entity || battle.Defender.Parent == Entity).Sum(battle => battle.AttackerDeathCount);
                    losses = war.Collections.OfType <Battle>().Where(battle => battle.Attacker == Entity || battle.Attacker.Parent == Entity).Sum(battle => battle.AttackerDeathCount) + war.Collections.OfType <Battle>().Where(battle => battle.Defender == Entity || battle.Defender.Parent == Entity).Sum(battle => battle.DefenderDeathCount);

                    warTable.AddData("(V/L)");
                    warTable.AddData("Battles:");
                    warTable.AddData(battleVictories.ToString(), 0, TableDataAlign.Right);
                    warTable.AddData("/");
                    warTable.AddData(battleLossses.ToString());
                    warTable.AddData("Sites:");
                    warTable.AddData(sitesDestroyed.ToString(), 0, TableDataAlign.Right);
                    warTable.AddData("/");
                    warTable.AddData(sitesLost.ToString());
                    warTable.AddData("Deaths:");
                    warTable.AddData(kills.ToString(), 0, TableDataAlign.Right);
                    warTable.AddData("/");
                    warTable.AddData(losses.ToString());
                    warTable.EndRow();
                }
                HTML.AppendLine(warTable.GetTable() + LineBreak);
            }
        }
Example #10
0
        private void PrintTitle()
        {
            string title = Entity.ToLink(false);

            if (Entity.IsCiv)
            {
                title += " is a civilization";
            }
            else
            {
                title += " is a ";
                switch (Entity.Type)
                {
                case EntityType.Civilization:
                    title += "civilization";
                    break;

                case EntityType.NomadicGroup:
                    title += "nomadic group";
                    break;

                case EntityType.MigratingGroup:
                    title += "migrating group";
                    break;

                case EntityType.Outcast:
                    title += "collection of outcasts";
                    break;

                case EntityType.Religion:
                    title += "religion";
                    break;

                case EntityType.SiteGovernment:
                    title += "site government";
                    break;

                case EntityType.PerformanceTroupe:
                    title += "performance troupe";
                    break;

                default:
                    title += "group";
                    break;
                }
            }
            if (!string.IsNullOrWhiteSpace(Entity.Race) && Entity.Race != "Unknown")
            {
                title += " of ";
                title += Entity.Race.ToLower();
            }
            if (Entity.Parent != null)
            {
                title += " of " + Entity.Parent.ToLink(true, Entity);
            }
            title += ".";
            HTML.AppendLine("<h1>" + title + "</h1></br>");

            if (Entity.IsCiv)
            {
                HTML.AppendLine(Entity.PrintIdenticon(true) + LineBreak + LineBreak);
            }

            if (Entity.SiteHistory.Count > 0)
            {
                if (Entity.SiteHistory.Count(sitePeriod => sitePeriod.EndYear == -1) == 0)
                {
                    HTML.AppendLine(Font("Last Known Sites. Year: " + (Entity.SiteHistory.Max(sitePeriod => sitePeriod.EndYear) - 1), "red"));
                }
                List <Bitmap> maps     = MapPanel.CreateBitmaps(World, Entity);
                TableMaker    mapTable = new TableMaker();
                mapTable.StartRow();
                mapTable.AddData(MakeLink(BitmapToHTML(maps[0]), LinkOption.LoadMap));
                mapTable.AddData(MakeLink(BitmapToHTML(maps[1]), LinkOption.LoadMap));
                mapTable.EndRow();
                HTML.AppendLine(mapTable.GetTable() + "</br>");
                maps[0].Dispose();
                maps[1].Dispose();
            }
        }
Example #11
0
        private void PrintTitle()
        {
            string title = Entity.ToLink(false);
            if (Entity.IsCiv)
            {
                title += " is a civilization";
            }
            else
            {
                title += " is a ";
                switch (Entity.Type)
                {
                    case EntityType.Civilization:
                        title += "civilization";
                        break;
                    case EntityType.NomadicGroup:
                        title += "nomadic group";
                        break;
                    case EntityType.MigratingGroup:
                        title += "migrating group";
                        break;
                    case EntityType.Outcast:
                        title += "collection of outcasts";
                        break;
                    case EntityType.Religion:
                        title += "religion";
                        break;
                    case EntityType.SiteGovernment:
                        title += "site government";
                        break;
                    case EntityType.PerformanceTroupe:
                        title += "performance troupe";
                        break;
                    default:
                        title += "group";
                        break;
                }
            }
            if (!string.IsNullOrWhiteSpace(Entity.Race) && Entity.Race != "Unknown")
            {
                title += " of ";
                title += Entity.Race.ToLower();
            }
            if (Entity.Parent != null) title += " of " + Entity.Parent.ToLink(true, Entity);
            title += ".";
            HTML.AppendLine("<h1>" + title + "</h1></br>");

            if (Entity.IsCiv)
                HTML.AppendLine(Entity.PrintIdenticon(true) + LineBreak + LineBreak);

            if (Entity.SiteHistory.Count > 0)
            {
                if (Entity.SiteHistory.Count(sitePeriod => sitePeriod.EndYear == -1) == 0)
                    HTML.AppendLine(Font("Last Known Sites. Year: " + (Entity.SiteHistory.Max(sitePeriod => sitePeriod.EndYear) - 1), "red"));
                List<Bitmap> maps = MapPanel.CreateBitmaps(World, Entity);
                TableMaker mapTable = new TableMaker();
                mapTable.StartRow();
                mapTable.AddData(MakeLink(BitmapToHTML(maps[0]), LinkOption.LoadMap));
                mapTable.AddData(MakeLink(BitmapToHTML(maps[1]), LinkOption.LoadMap));
                mapTable.EndRow();
                HTML.AppendLine(mapTable.GetTable() + "</br>");
                maps[0].Dispose();
                maps[1].Dispose();
            }
        }