Пример #1
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            if (link)
            {
                string title = Type;
                title += "&#13";
                title += Attacker.PrintEntity(false) + " (Attacker)";
                title += "&#13";
                title += Defender.PrintEntity(false) + " (Defender)";
                title += "&#13";
                title += "Deaths: " + DeathCount + " | (" + StartYear + " - " + (EndYear == -1 ? "Present" : EndYear.ToString()) + ")";

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"collection#" + Id + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>";
                }
                return(linkedString);
            }
            return(Name);
        }
Пример #2
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         string title;
         if (IsCiv)
         {
             title = "Civilization of " + Race;
         }
         else
         {
             title = "Group of " + Race;
         }
         if (Parent != null)
         {
             title += ", of " + Parent.Name;
         }
         if (pov != this)
         {
             return(Icon + "<a href = \"entity#" + Id + "\" title=\"" + title + "\">" + Name + "</a>");
         }
         return(Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>");
     }
     return(Name);
 }
Пример #3
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            string name;

            if (Type == "Cavern")
            {
                name = "the depths of the world";
            }
            else if (Type == "Underworld")
            {
                name = "the Underworld";
            }
            else
            {
                name = "an underground region (" + Type + ")";
            }

            if (link)
            {
                string title = Type;
                title += "&#13";
                title += "Events: " + Events.Count;

                if (pov != this)
                {
                    return(Icon + "<a href = \"uregion#" + Id + "\" title=\"" + title + "\">" + name + "</a>");
                }

                return(Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(name) + "</a>");
            }
            return(name);
        }
Пример #4
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string type = null;
                if (Type != WrittenContentType.Unknown)
                {
                    type = Type.GetDescription();
                }
                string title = "Written Content";
                title += string.IsNullOrWhiteSpace(type) ? "" : ", " + type;
                title += "&#13";
                title += "Events: " + Events.Count;

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"writtencontent#" + Id + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>";
                }
                return(linkedString);
            }
            return(Name);
        }
Пример #5
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (this == Unknown)
            {
                return(Name);
            }

            if (link)
            {
                string icon = GetIcon();
                if (pov == null || pov != this)
                {
                    if (pov != null && pov.GetType() == typeof(BeastAttack) && (pov as BeastAttack)?.Beast == this) //Highlight Beast when printing Beast Attack Log
                    {
                        return(icon + "<a href=\"hf#" + Id + "\" title=\"" + Title + "\"><font color=#339900>" + ShortName + "</font></a>");
                    }

                    return("the " + RaceString + " " + icon + "<a href=\"hf#" + Id + "\" title=\"" + Title + "\">" + Name + "</a>");
                }
                return("<a href=\"hf#" + Id + "\" title=\"" + Title + "\">" + HtmlStyleUtil.CurrentDwarfObject(ShortName) + "</a>");
            }
            if (pov == null || pov != this)
            {
                return(RaceString + " " + Name);
            }
            return(ShortName);
        }
Пример #6
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            if (link)
            {
                string title = "";
                if (StructureSubType != StructureSubType.Unknown)
                {
                    title += StructureSubType.GetDescription();
                }
                else
                {
                    title += Type.GetDescription();
                }
                title += "&#13";
                title += "Events: " + Events.Count;

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"structure#" + GlobalId + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>";
                }
                return(linkedString);
            }
            return(Icon + Name);
        }
Пример #7
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            string name = "The " + GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false);

            if (link)
            {
                string title = Type;
                title += "&#13";
                if (Attacker != null)
                {
                    title += Attacker.PrintEntity(false) + " (Attacker)(V)";
                    title += "&#13";
                }
                if (Defender != null)
                {
                    title += Defender.PrintEntity(false) + " (Defender)";
                }

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = "<a href = \"collection#" + Id + "\" title=\"" + title + "\"><font color=\"6E5007\">" + name + "</font></a>";
                    if (pov != Battle)
                    {
                        linkedString += " as a result of " + Battle.ToLink();
                    }
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(name) + "</a>";
                }
                return(linkedString);
            }
            return(name);
        }
Пример #8
0
 public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
 {
     if (link)
     {
         if (pov != this)
         {
             return(Icon + "<a href = \"entity#" + Id + "\" title=\"" + GetToolTip() + "\">" + Name + "</a>");
         }
         return(Icon + "<a title=\"" + GetToolTip() + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>");
     }
     return(Name);
 }
Пример #9
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         string title = "Artifact" + (!string.IsNullOrEmpty(Type) ? ", " + Type : "");
         title += "&#13";
         title += "Events: " + Events.Count;
         if (pov != this)
         {
             return(Icon + "<a href = \"artifact#" + Id + "\" title=\"" + title + "\">" + Name + "</a>");
         }
         return(Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>");
     }
     return(Name);
 }
Пример #10
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string title = Type;
                title += "&#13";
                title += "Events: " + Events.Count;

                if (pov != this)
                {
                    return(Icon + "<a href = \"region#" + Id + "\" title=\"" + title + "\">" + Name + "</a>");
                }
                return(Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>");
            }
            return(Name);
        }
Пример #11
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            string name = "";

            name = "The " + GetOrdinal(Ordinal) + "rampage of ";
            if (Beast != null && pov == Beast)
            {
                name += Beast.ToLink(false, Beast);
            }
            else if (Beast != null)
            {
                name += Beast.Name;
            }
            else
            {
                name += "UNKNOWN BEAST";
            }

            if (pov != Site)
            {
                name += " in " + Site.ToLink(false);
            }

            if (link)
            {
                string title = "Beast Attack";
                title += "&#13";
                title += "Events: " + GetSubEvents().Count;

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"collection#" + Id + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + name + "</font></a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(name) + "</a>";
                }

                return(linkedString);
            }
            if (pov == this)
            {
                return("Rampage of " + Beast.ToLink(false, Beast));
            }
            return(name);
        }
Пример #12
0
        protected void PopulatePopulationChartData(List <Population> populations)
        {
            if (populations.Count == 0)
            {
                Html.AppendLine("$('#chart-populationbyrace-container').hide()");
                return;
            }
            string races            = "";
            string popCounts        = "";
            string backgroundColors = "";

            for (int i = 0; i < populations.Count; i++)
            {
                Population civilizedPop      = populations[i];
                Color      civilizedPopColor = World.MainRaces.ContainsKey(civilizedPop.Race)
                    ? World.MainRaces.First(r => r.Key == civilizedPop.Race).Value
                    : Color.Gray;

                Color darkenedPopColor = HtmlStyleUtil.ChangeColorBrightness(civilizedPopColor, -0.1f);

                races            += (i != 0 ? "," : "") + "'" + civilizedPop.Race.NamePlural + "'";
                popCounts        += (i != 0 ? "," : "") + civilizedPop.Count;
                backgroundColors += (i != 0 ? "," : "") + "'" + ColorTranslator.ToHtml(darkenedPopColor) + "'";
            }

            Html.AppendLine("setTimeout(function(){");
            Html.AppendLine("var chartPopulationByRace = new Chart(document.getElementById('chart-populationbyrace').getContext('2d'), { type: 'doughnut', ");
            Html.AppendLine("data: {");
            Html.AppendLine("labels: [" + races + "], ");
            Html.AppendLine("datasets:[{");
            Html.AppendLine("data:[" + popCounts + "], ");
            Html.AppendLine("backgroundColor:[" + backgroundColors + "]");
            Html.AppendLine("}],");
            Html.AppendLine("},");
            Html.AppendLine("options:{");
            Html.AppendLine("maintainAspectRatio: false,");
            Html.AppendLine("legend:{");
            Html.AppendLine("position:'right',");
            Html.AppendLine("labels: { boxWidth: 12 }");
            Html.AppendLine("}");
            Html.AppendLine("}");
            Html.AppendLine("});");
            Html.AppendLine("}, 10);");
        }
Пример #13
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            if (link)
            {
                string title = Type;
                title += "&#13";
                title += Attacker != null?Attacker.PrintEntity(false) : "UNKNOWN";

                title += " (Attacker)";
                if (Victor == Attacker)
                {
                    title += "(V)";
                }

                title += "&#13";
                title += "Kills: " + DefenderDeathCount;
                title += "&#13";
                title += Defender != null?Defender.PrintEntity(false) : "UNKNOWN";

                title += " (Defender)";
                if (Victor == Defender)
                {
                    title += "(V)";
                }

                title += "&#13";
                title += "Kills: " + AttackerDeathCount;

                string linkedString;
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"collection#" + Id + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>";
                }
                return(linkedString);
            }
            return(Name);
        }
Пример #14
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = "Dance Form";
                    title += "&#13";
                    title += "Events: " + Events.Count;

                    linkedString = Icon + "<a href=\"danceform#" + Id + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                {
                    linkedString = Icon + HtmlStyleUtil.CurrentDwarfObject(Name);
                }
                return(linkedString);
            }
            return(Name);
        }
Пример #15
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            if (link)
            {
                string title = Type;
                title += "&#13";
                title += "Items Stolen: " + ItemsStolenCount;

                string linkedString = "";
                if (pov != this)
                {
                    linkedString = Icon + "<a href = \"collection#" + Id + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                {
                    linkedString = Icon + "<a title=\"" + title + "\">" + HtmlStyleUtil.CurrentDwarfObject(Name) + "</a>";
                }
                return(linkedString);
            }
            return(Name);
        }
Пример #16
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = "";
                    title += IsVolcano ? "Volcano" : "Mountain Peak";
                    title += "&#13";
                    title += "Events: " + Events.Count;

                    linkedString = Icon + "<a href = \"mountainpeak#" + Id + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                {
                    linkedString = Icon + HtmlStyleUtil.CurrentDwarfObject(Name);
                }

                return(linkedString);
            }
            return(Name);
        }
Пример #17
0
        private void PopulateWorldOverviewData()
        {
            string races            = "";
            string popCounts        = "";
            string backgroundColors = "";

            for (int i = 0; i < _world.CivilizedPopulations.Count; i++)
            {
                Population civilizedPop      = _world.CivilizedPopulations[i];
                Color      civilizedPopColor = World.MainRaces.ContainsKey(civilizedPop.Race)
                    ? World.MainRaces.First(r => r.Key == civilizedPop.Race).Value
                    : Color.Gray;

                Color darkenedPopColor = HtmlStyleUtil.ChangeColorBrightness(civilizedPopColor, -0.1f);

                races            += (i != 0 ? "," : "") + "'" + civilizedPop.Race + "'";
                popCounts        += (i != 0 ? "," : "") + civilizedPop.Count;
                backgroundColors += (i != 0 ? "," : "") + "'" + ColorTranslator.ToHtml(darkenedPopColor) + "'";
            }

            Html.AppendLine("var chartPopulationByRace = new Chart(document.getElementById('chart-populationbyrace').getContext('2d'), { type: 'doughnut', ");
            Html.AppendLine("data: {");
            Html.AppendLine("labels: [" + races + "], ");
            Html.AppendLine("datasets:[{");
            Html.AppendLine("data:[" + popCounts + "], ");
            Html.AppendLine("backgroundColor:[" + backgroundColors + "]");
            Html.AppendLine("}],");
            Html.AppendLine("},");
            Html.AppendLine("options:{");
            Html.AppendLine("maintainAspectRatio: false,");
            Html.AppendLine("legend:{");
            Html.AppendLine("position:'right',");
            Html.AppendLine("labels: { boxWidth: 12 }");
            Html.AppendLine("}");
            Html.AppendLine("}");
            Html.AppendLine("});");
        }
Пример #18
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = "";
                    title += "World Construction";
                    title += Type != WorldConstructionType.Unknown ? "" : ", " + Type;
                    title += "&#13";
                    title += "Events: " + Events.Count;

                    linkedString = Icon + "<a href = \"worldconstruction#" + Id + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                {
                    linkedString = Icon + HtmlStyleUtil.CurrentDwarfObject(Name);
                }

                return(linkedString);
            }
            return(Name);
        }
Пример #19
0
        public string ToTreeLeafLink(DwarfObject pov = null)
        {
            string dead = DeathYear != -1 ? "<br/>" + HtmlStyleUtil.SymbolDead : "";

            if (pov == null || pov != this)
            {
                return("<a " + (Deity ? "class=\"hf_deity\"" : "") + " href=\"hf#" + Id + "\" title=\"" + Title + "\">" + Race + (Deity ? " Deity" : "") + "<br/>" + Name + dead + "</a>");
            }
            return("<a " + (Deity ? "class=\"hf_deity\"" : "") + " title=\"" + Title + "\">" + Race + (Deity ? " Deity" : "") + "<br/>" + HtmlStyleUtil.CurrentDwarfObject(Name) + dead + "</a>");
        }