예제 #1
0
        public override string ToLink(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            //if (link)
            //{
            //    string 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;
            //}
            //else
            //{
            //    return Icon + Name;
            //}
            return(Name);
        }
예제 #2
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    linkedString = "<a href = \"collection#" + this.ID + "\"><font color=\"800000\">" + "The " + this.GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false) + "</font></a>";
                    if (pov != Battle)
                    {
                        linkedString += " as a result of " + Battle.ToLink();
                    }
                }
                else
                {
                    linkedString = "<font color=\"Blue\">" + "The " + this.GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false) + "</font>";
                }

                return(linkedString);
            }
            else
            {
                return("The " + this.GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false));
            }
        }
예제 #3
0
파일: War.cs 프로젝트: karv/Legends-Viewer
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = Attacker.PrintEntity(false) + " (Attacker)&#13" + Defender.PrintEntity(false) + " (Defender)&#13Deaths: " + DeathCount + " | (" + StartYear + " - ";
                    if (EndYear == -1)
                    {
                        title += "Present)";
                    }
                    else
                    {
                        title += EndYear + ")";
                    }
                    linkedString = "<a href = \"collection#" + this.ID + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                {
                    linkedString = "<font color=\"Blue\">" + Name + "</font>";
                }

                return(linkedString);
            }
            else
            {
                return(Name);
            }
        }
예제 #4
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string title = "";
                if (DungeonType != DungeonType.Unknown)
                {
                    title += DungeonType.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);
        }
예제 #5
0
        public override string ToLink(bool link = true, DwarfObject pov = 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);
        }
예제 #6
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);
        }
예제 #7
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = Attacker.PrintEntity(false) + " (Attacker)";
                    if (Victor == Attacker) title += "(V)";
                    title += "&#13";
                    title += "Kills: " + DefenderDeathCount;
                    title += "&#13";
                    title += Defender.PrintEntity(false) + " (Defender)";
                    if (Victor == Defender) title += "(V)";
                    title += "&#13";
                    title += "Kills: " + AttackerDeathCount;

                    linkedString = "<a href = \"collection#" + this.ID + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                    linkedString = "<font color=\"Blue\">" + Name + "</font>";
                return linkedString;
            }
            else
                return Name;
        }
예제 #8
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);
        }
예제 #9
0
 public OwnerPeriod(Site site, DwarfObject newowner, int year, string cause)
 {
     Site = site; Owner = newowner; StartYear = year; StartCause = cause; EndYear = -1;
     if (Owner != null && Owner is Entity)
         ((Entity) Owner).AddOwnedSite(this);
     Site.OwnerHistory.Add(this);
 }
예제 #10
0
        public string Print(bool link = true, DwarfObject pov = null, WorldEvent worldEvent = null)
        {
            var identityString = "the ";

            if (Race != null && Race != CreatureInfo.Unknown)
            {
                identityString += Race.NameSingular.ToLower();
            }
            else
            {
                identityString += HistoricalFigure.GetRaceString();
            }

            if (!string.IsNullOrWhiteSpace(Profession))
            {
                identityString += " " + Profession.ToLower();
            }
            var icon = !string.IsNullOrWhiteSpace(Caste) ? GetIcon() : HistoricalFigure.GetIcon();

            if (!string.IsNullOrWhiteSpace(icon))
            {
                identityString += " " + icon;
            }
            identityString += " " + Name;
            if (Entity != null)
            {
                identityString += " of ";
                identityString += Entity.ToLink(link, pov, worldEvent);
            }
            return(identityString);
        }
예제 #11
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            string name;

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

            if (link)
            {
                if (pov != this)
                {
                    return("<a href = \"uregion#" + this.ID + "\">" + name + "</a>");
                }
                else
                {
                    return(HTMLStyleUtil.CurrentDwarfObject(name));
                }
            }
            else
            {
                return(name);
            }
        }
예제 #12
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 linkedString = "";
                if (pov != this)
                {
                    string title = "Events: " + GetSubEvents().Count;

                    linkedString = "<a href = \"collection#" + this.ID + "\" title=\"" + title + "\"><font color=\"#336600\">" + name + "</font></a>";
                }
                else
                    linkedString = "<font color=\"Blue\">" + name + "</font>";
                return linkedString;
            }
            else
                if (pov == this) return "Rampage of " + Beast.ToLink(false, Beast);
            return name;
        }
예제 #13
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);
 }
예제 #14
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     return "an abduction";
     /*string colString = this.GetYearTime(true) + "The " + ordinals[numeral] + " abduction of ";
     if (abductee != null) colString += abductee.ToLink(path, pov);
     else colString += "UNKNOWN FIGURE";
                      return colString + " in " + period.ToLink(path, pov) + " ocurred";*/
 }
예제 #15
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            return("an abduction");

            /*string colString = this.GetYearTime(true) + "The " + ordinals[numeral] + " abduction of ";
             * if (abductee != null) colString += abductee.ToLink(path, pov);
             * else colString += "UNKNOWN FIGURE";
             *               return colString + " in " + period.ToLink(path, pov) + " ocurred";*/
        }
예제 #16
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (Name != "")
            {
                return(Name);
            }

            return("(" + StartYear + " - " + EndYear + ")");
        }
예제 #17
0
        public string Print(bool link = true, DwarfObject pov = null)
        {
            if (Structure != null)
            {
                return(Structure.ToLink(link, pov));
            }

            return("a " + Type.GetDescription());
        }
예제 #18
0
 public OwnerPeriod(Site site, DwarfObject newowner, int year, string cause)
 {
     Site = site; Owner = newowner; StartYear = year; StartCause = cause; EndYear = -1;
     if (Owner != null && Owner is Entity)
     {
         ((Entity)Owner).AddOwnedSite(this);
     }
     Site.OwnerHistory.Add(this);
 }
예제 #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>");
        }
예제 #20
0
        public string PrintEntity(bool link = true, DwarfObject pov = null)
        {
            string entityString = ToLink(link, pov);

            if (Parent != null)
            {
                entityString += " of " + Parent.ToLink(link, pov);
            }
            return(entityString);
        }
예제 #21
0
 public override string ToLink(bool link = true, DwarfObject pov = 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);
 }
예제 #22
0
 public void AddPlayerRelatedDwarfObjects(DwarfObject dwarfObject)
 {
     if (dwarfObject == null)
     {
         return;
     }
     if (PlayerRelatedObjects.Contains(dwarfObject))
     {
         return;
     }
     PlayerRelatedObjects.Add(dwarfObject);
 }
예제 #23
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (this == HistoricalFigure.Unknown)
     {
         return(this.Name);
     }
     if (link)
     {
         if ((pov == null || pov != this))
         {
             string title = Caste + ", " + AssociatedType + " (" + BirthYear + " - ";
             if (DeathYear == -1)
             {
                 title += "Present)";
             }
             else
             {
                 title += DeathYear + ")";
             }
             title += "&#13Events: " + Events.Count;
             if (pov != null && pov.GetType() == typeof(BeastAttack) && (pov as BeastAttack).Beast == this) //Highlight Beast when printing Beast Attack Log
             {
                 if (this.Name.IndexOf(" ") > 0)
                 {
                     return("<a href=\"hf#" + this.ID + "\" title=\"" + title + "\"><font color=#339900>" + this.Name.Substring(0, this.Name.IndexOf(" ")) + "</font></a>");
                 }
                 else
                 {
                     return("<a href=\"hf#" + this.ID + "\" title=\"" + title + "\"><font color=#339900>" + this.Name + "</font></a>");
                 }
             }
             else
             {
                 return("the " + GetRaceString() + " " + "<a href = \"hf#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>");
             }
         }
         else
         {
             return(HTMLStyleUtil.CurrentDwarfObject(Name.IndexOf(" ") > 0 ? Name.Substring(0, Name.IndexOf(" ")) : Name));
         }
     }
     else if ((pov == null || pov != this))
     {
         return(GetRaceString() + " " + Name);
     }
     else
     {
         return(Name.IndexOf(" ") > 0 ? Name.Substring(0, Name.IndexOf(" ")) : Name);
     }
 }
예제 #24
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         if (pov != this)
         {
             string title = Type + " | Events: " + Events.Count;
             return "<a href = \"region#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>";
         }
         else
             return "<font color=\"Blue\">" + this.Name + "</font>";
     }
     else
         return this.Name;
 }
예제 #25
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);
 }
예제 #26
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         if (pov != this)
         {
             string title = Type + " | Events: " + Events.Count;
             return "<a href = \"region#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>";
         }
         else
             return HTMLStyleUtil.CurrentDwarfObject(Name);
     }
     else
         return this.Name;
 }
예제 #27
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);
        }
예제 #28
0
        public OwnerPeriod(Site site, DwarfObject owner, int startYear, string startCause)
        {
            Site       = site;
            Owner      = owner;
            StartYear  = startYear;
            StartCause = startCause;
            EndYear    = -1;

            if (Owner is Entity entity)
            {
                entity.AddOwnedSite(this);
            }
            else
            {
                Console.WriteLine();
            }
        }
예제 #29
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            string name;
            if (this.Type == "Cavern") name = "the depths of the world";
            else if (this.Type == "Underworld") name = "the Underworld";
            else name = "an underground region (" + this.Type + ")";

            if (link)
            {
                if (pov != this)
                    return "<a href = \"uregion#" + this.ID + "\">" + name + "</a>";
                else
                    return HTMLStyleUtil.CurrentDwarfObject(name);
            }
            else
                return name;
        }
예제 #30
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            //if (link)
            //{
            //    string linkedString = "";
            //    if (pov != this)
            //    {
            //        string title = "Events: " + this.Events.Count;

            //        linkedString = "<a href = \"structure#" + this.ID + "\" title=\"" + title + "\">" + Name + "</a>";
            //    }
            //    else
            //        linkedString = HTMLStyleUtil.CurrentDwarfObject(Name);
            //    return linkedString;
            //}
            //else
                return Name;
        }
예제 #31
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    linkedString = "<a href = \"collection#" + this.ID + "\"><font color=\"800000\">" + "The " + this.GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false) + "</font></a>";
                    if (pov != Battle) linkedString += " as a result of " + Battle.ToLink();
                }
                else
                    linkedString = "<font color=\"Blue\">" + "The " + this.GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false) + "</font>";

                return linkedString;
            }
            else
                return "The " + this.GetOrdinal(Ordinal) + ConquerType + " of " + Site.ToLink(false);
        }
예제 #32
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = "Events: " + this.Events.Count;

                    linkedString = "<a href = \"artifact#" + this.ID + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                    linkedString = "<font color=\"Blue\">" + Name + "</font>";
                return linkedString;
            }
            else
                return Name;
        }
예제 #33
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = "Events: " + this.Events.Count;

                    linkedString = "<a href = \"worldconstruction#" + this.ID + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                    linkedString = HTMLStyleUtil.CurrentDwarfObject(Name);
                return linkedString;
            }
            else
                return Name;
        }
예제 #34
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            //if (link)
            //{
            //    string linkedString = "";
            //    if (pov != this)
            //    {
            //        string title = "Events: " + this.Events.Count;

            //        linkedString = "<a href = \"structure#" + this.ID + "\" title=\"" + title + "\">" + Name + "</a>";
            //    }
            //    else
            //        linkedString = HTMLStyleUtil.CurrentDwarfObject(Name);
            //    return linkedString;
            //}
            //else
            return(Name);
        }
예제 #35
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         if (pov != this)
         {
             string title = Type + " | Events: " + Events.Count;
             return("<a href = \"region#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>");
         }
         else
         {
             return("<font color=\"Blue\">" + this.Name + "</font>");
         }
     }
     else
     {
         return(this.Name);
     }
 }
예제 #36
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         if (pov != this)
         {
             string title = Type + "&#13Events: " + Events.Count;
             return("<a href = \"site#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>");
         }
         else
         {
             return(HTMLStyleUtil.CurrentDwarfObject(Name));
         }
     }
     else
     {
         return(Name);
     }
 }
예제 #37
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 linkedString = "";
                if (pov != this)
                {
                    string title = "Events: " + GetSubEvents().Count;

                    linkedString = "<a href = \"collection#" + this.ID + "\" title=\"" + title + "\"><font color=\"#336600\">" + name + "</font></a>";
                }
                else
                {
                    linkedString = "<font color=\"Blue\">" + name + "</font>";
                }
                return(linkedString);
            }
            else
            if (pov == this)
            {
                return("Rampage of " + Beast.ToLink(false, Beast));
            }
            return(name);
        }
예제 #38
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);
        }
예제 #39
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                if (pov != this)
                {
                    string title = "";
                    if (IsCiv)
                    {
                        title = "Civilization of " + Race;
                    }
                    else
                    {
                        title = "Group of " + Race;
                    }
                    if (Parent != null)
                    {
                        title += ", of " + Parent.Name;
                    }

                    string entityLink = "<a href = \"entity#" + ID + "\" title=\"" + title + "\">" + Name + "</a>";
                    if (IsCiv)
                    {
                        return(PrintIdenticon() + " " + entityLink + " ");
                    }
                    else
                    {
                        return(entityLink);
                    }
                }
                else
                {
                    return(HTMLStyleUtil.CurrentDwarfObject(Name));
                }
            }
            else
            {
                return(Name);
            }
        }
예제 #40
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = "Events: " + this.Events.Count;

                    linkedString = "<a href = \"artifact#" + this.ID + "\" title=\"" + title + "\">" + Name + "</a>";
                }
                else
                {
                    linkedString = "<font color=\"Blue\">" + Name + "</font>";
                }
                return(linkedString);
            }
            else
            {
                return(Name);
            }
        }
예제 #41
0
        public static List<Bitmap> CreateBitmaps(World world, DwarfObject dwarfObject)
        {
            int maxSize = world.PageMiniMap.Height > world.PageMiniMap.Width ? world.PageMiniMap.Height : world.PageMiniMap.Width;
            MapPanel createBitmaps = new MapPanel(world.Map, world, null, dwarfObject);
            createBitmaps.Height = maxSize;
            createBitmaps.Width = maxSize;
            if (createBitmaps.ZoomToBoundsOnFirstPaint) createBitmaps.ZoomToBounds();

            createBitmaps.MiniMapAreaSideLength = maxSize;
            //createBitmaps.SetupMinimap();
            createBitmaps.Minimap = world.PageMiniMap;

            Bitmap miniMap = new Bitmap(maxSize, maxSize);

            using (Graphics miniMapGraphics = Graphics.FromImage(miniMap))
                createBitmaps.DrawMiniMap(miniMapGraphics);

            Bitmap map = new Bitmap(maxSize, maxSize);

            using (Graphics mapGraphics = Graphics.FromImage(map))
            {
                //mapGraphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
                mapGraphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
                createBitmaps.DrawMap(mapGraphics);
                createBitmaps.DrawDisplayObjects(mapGraphics);
                createBitmaps.Dispose();
                return new List<Bitmap>() { map, miniMap };
            }
        }
예제 #42
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = Attacker.PrintEntity(false) + " (Attacker)";
                    if (Victor == Attacker) title += "(V)";
                    title += "&#13";
                    title += "Kills: " + DefenderDeathCount;
                    title += "&#13";
                    title += Defender.PrintEntity(false) + " (Defender)";
                    if (Victor == Defender) title += "(V)";
                    title += "&#13";
                    title += "Kills: " + AttackerDeathCount;

                    linkedString = "<a href = \"collection#" + this.ID + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                    linkedString = "<font color=\"Blue\">" + Name + "</font>";
                return linkedString;
            }
            else
                return Name;
        }
예제 #43
0
파일: War.cs 프로젝트: Riock/Legends-Viewer
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                string linkedString = "";
                if (pov != this)
                {
                    string title = Attacker.PrintEntity(false) + " (Attacker)&#13" + Defender.PrintEntity(false) + " (Defender)&#13Deaths: " + DeathCount + " | (" + StartYear + " - ";
                    if (EndYear == -1) title += "Present)";
                    else title += EndYear + ")";
                    linkedString = "<a href = \"collection#" + this.ID + "\" title=\"" + title + "\"><font color=\"#6E5007\">" + Name + "</font></a>";
                }
                else
                    linkedString = "<font color=\"Blue\">" + Name + "</font>";

                return linkedString;
            }
            else
                return Name;
        }
예제 #44
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     return "a duel";
 }
예제 #45
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (link)
     {
         if (pov != this)
         {
             string title = "";
             if (IsCiv) title = "Civilization of " + Race;
             else title = "Group of " + Race;
             if (Parent != null) title += ", of " + Parent.Name;
             string entityLink = "<a href = \"entity#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>";
             if (IsCiv) return entityLink + " " + PrintIdenticon() + " ";
             else return entityLink;
         }
         else
             return "<font color=\"Blue\">" + this.Name + "</font>";
     }
     else
         return this.Name;
 }
예제 #46
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (this == HistoricalFigure.Unknown) return this.Name;
            if (link)
                if ((pov == null || pov != this))
                {
                    string title = Caste + ", " + AssociatedType + " (" + BirthYear + " - ";
                    if (DeathYear == -1) title += "Present)";
                    else title += DeathYear + ")";
                    title += "&#13Events: " + Events.Count;
                    if (pov != null && pov.GetType() == typeof(BeastAttack) && (pov as BeastAttack).Beast == this) //Highlight Beast when printing Beast Attack Log
                        if (this.Name.IndexOf(" ") > 0)
                            return "<a href = \"hf#" + this.ID + "\" title=\"" + title + "\"><font color=#339900>" + this.Name.Substring(0, this.Name.IndexOf(" ")) + "</font></a>";
                        else return "<a href = \"hf#" + this.ID + "\" title=\"" + title + "\"><font color=#339900>" + this.Name + "</font></a>";
                    else
                        return "the " + GetRaceString() + " " + "<a href = \"hf#" + this.ID + "\" title=\"" + title + "\">" + this.Name + "</a>";
                }
                else// (pov != null && pov.ID == this.ID)
                    if (this.Name.IndexOf(" ") > 0)
                        return "<font color=\"Blue\">" + this.Name.Substring(0, this.Name.IndexOf(" ")) + "</font>";
                    else
                        return "<font color=\"Blue\">" + this.Name + "</font>";
            else

                if ((pov == null || pov != this))
                    return GetRaceString() + " " + this.Name;
                else //(pov != null && pov.ID == this.ID)
                    if (this.Name.IndexOf(" ") > 0)
                        return this.Name.Substring(0, this.Name.IndexOf(" ") + 1);
                    else
                        return this.Name;
        }
예제 #47
0
 public ChartControl(World world, DwarfObject focusObject, DwarfTabControl dwarfTabControl)
 {
     World = world; FocusObject = focusObject; TabControl = dwarfTabControl;
     Title = "Chart";
     if (FocusObject != null) Title += " - " + FocusObject.ToLink(false, FocusObject);
 }
예제 #48
0
        public ChartPanel(World world, DwarfObject focusObject, List<ChartOption> options = null)
        {
            Dock = DockStyle.Fill;

            FocusObject = focusObject as DwarfObject;
            World = world;
            DwarfChart = new Chart();
            DwarfChart.Dock = DockStyle.Fill;
            Controls.Add(DwarfChart);
            this.Refresh();

            DwarfChart.BackColor = Color.Wheat;
            DwarfChart.BackGradientStyle = GradientStyle.TopBottom;
            DwarfChart.ChartAreas.Add(new ChartArea());
            DwarfChart.ChartAreas.Last().AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
            DwarfChart.ChartAreas.Last().BackColor = Color.FromArgb(235, 235, 235);
            DwarfChart.Legends.Add(new Legend());
            DwarfChart.Legends.Last().LegendStyle = LegendStyle.Row;
            DwarfChart.Legends.Last().Position.Width = 100;
            DwarfChart.Legends.Last().Position.Y = 100;
            DwarfChart.Legends.Last().Position.Height = 4;
            DwarfChart.Titles.Add(new Title());
            DwarfChart.Titles.Last().Position.Auto = false;
            DwarfChart.Titles.Last().Position.X = 50;
            DwarfChart.Titles.Last().Position.Y = 1.5f;
            if (options != null) SeriesOptions = options;
            else if (FocusObject.GetType() == typeof(Battle))
                SeriesOptions.Add(ChartOption.OtherBattleRemaining);
            else
            {
                SeriesOptions.Add(ChartOption.TimelineEvents);
                SeriesOptions.Add(ChartOption.TimelineEventsFiltered);
            }
            SetupMenu();
            //GenerateSeries();
        }
예제 #49
0
 protected string MakeLink(string text, DwarfObject dObject, ControlOption option = ControlOption.HTML)
 {
     //<a href=\"collection#" + attack.ID + "\">" + attack.GetOrdinal(attack.Ordinal)
     string objectType = "";
     int id = 0;
     if (dObject is EventCollection)
     {
         objectType = "collection";
         id = (dObject as EventCollection).ID;
     }
     else if (dObject.GetType() == typeof(HistoricalFigure))
     {
         objectType = "hf";
         id = (dObject as HistoricalFigure).ID;
     }
     else if (dObject.GetType() == typeof(Entity))
     {
         objectType = "entity";
         id = (dObject as Entity).ID;
     }
     else if (dObject.GetType() == typeof(WorldRegion))
     {
         objectType = "region";
         id = (dObject as WorldRegion).ID;
     }
     else if (dObject.GetType() == typeof(UndergroundRegion))
     {
         objectType = "uregion";
         id = (dObject as UndergroundRegion).ID;
     }
     else if (dObject.GetType() == typeof(Site))
     {
         objectType = "site";
         id = (dObject as Site).ID;
     }
     else throw new Exception("Unhandled make link for type: " + dObject.GetType());
     string optionString = "";
     if (option != ControlOption.HTML)
         optionString = "-" + option.ToString();
     return "<a href=\"" + objectType + "#" + id + optionString + "\">" + text + "</a>";
 }
예제 #50
0
 protected void PrintEventLog(List<WorldEvent> events, List<string> filters, DwarfObject dfo)
 {
     if (!events.Any())
     {
         return;
     }
     HTML.AppendLine("<b>Event Log</b> " + MakeLink(Font("[Chart]", "Maroon"), LinkOption.LoadChart) + "<br/><br/>");
     foreach (var e in events)
     {
         if (filters == null || !filters.Contains(e.Type))
         {
             HTML.AppendLine(e.Print(true, dfo) + "<br /><br />");
         }
     }
 }
예제 #51
0
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     return "a "+(!string.IsNullOrWhiteSpace(Adjective) ? Adjective.ToLower()+" " : "")+"purge";
 }
예제 #52
0
 public virtual string ToLink(bool link = true, DwarfObject pov = null)
 {
     return "";
 }
예제 #53
0
 public string PrintEntity(bool link = true, DwarfObject pov = null)
 {
     string entityString = this.ToLink(link, pov);
     if (this.Parent != null) entityString += " of " + Parent.ToLink(link, pov);
     return entityString;
 }
예제 #54
0
        public override string ToLink(bool link = true, DwarfObject pov = null)
        {
            if (link)
            {
                if (pov != this)
                {
                    string title = "";
                    if (IsCiv)
                    {
                        title = "Civilization of " + Race;
                    }
                    else
                    {
                        title = "Group of " + Race;
                    }
                    if (Parent != null)
                    {
                        title += ", of " + Parent.Name;
                    }

                    string entityLink = "<a href = \"entity#" + ID + "\" title=\"" + title + "\">" + Name + "</a>";
                    if (IsCiv)
                    {
                        return PrintIdenticon() + " " + entityLink + " ";
                    }
                    else
                    {
                        return entityLink;
                    }
                }
                else
                    return HTMLStyleUtil.CurrentDwarfObject(Name);
            }
            else
                return Name;
        }
예제 #55
0
파일: Era.cs 프로젝트: Riock/Legends-Viewer
 public override string ToLink(bool link = true, DwarfObject pov = null)
 {
     if (Name != "") return Name;
     else return "(" + StartYear + " - " + EndYear + ")";
 }