public override string Print(bool link = true, DwarfObject pov = null)
        {
            string eventString = GetYearTime();

            eventString += DestEntity.ToLink(link, pov, this);
            eventString += " made a copy of ";
            if (FromOriginal)
            {
                eventString += "the original ";
            }
            eventString += Artifact.ToLink(link, pov, this);
            eventString += " from ";
            eventString += SourceStructure.ToLink(link, pov, this);
            eventString += " in ";
            eventString += SourceSite.ToLink(link, pov, this);
            eventString += " of ";
            eventString += SourceEntity.ToLink(link, pov, this);
            eventString += " keeping it within ";
            eventString += DestStructure.ToLink(link, pov, this);
            eventString += " in ";
            eventString += DestSite.ToLink(link, pov, this);
            eventString += PrintParentCollection(link, pov);
            eventString += ".";
            return(eventString);
        }
Beispiel #2
0
        public Trade(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "trader_hfid": Trader = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break;

                case "trader_entity_id": TraderEntity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "source_site_id": SourceSite = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "dest_site_id": DestSite = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "production_zone_id": ProductionZoneId = Convert.ToInt32(property.Value); break;

                case "allotment": Allotment = Convert.ToInt32(property.Value); break;

                case "allotment_index": AllotmentIndex = Convert.ToInt32(property.Value); break;

                case "account_shift": AccountShift = Convert.ToInt32(property.Value); break;
                }
            }


            SourceSite.AddEvent(this);
            DestSite.AddEvent(this);
            Trader.AddEvent(this);
            TraderEntity.AddEvent(this);
        }
Beispiel #3
0
        public override string Print(bool link = true, DwarfObject pov = null)
        {
            string eventString = GetYearTime();

            eventString += Trader.ToLink(link, pov, this);
            if (TraderEntity != null)
            {
                eventString += " of ";
                eventString += TraderEntity.ToLink(link, pov, this);
            }
            // same ranges like in "gamble" event
            var balance = AccountShift;

            if (balance >= 5000)
            {
                eventString += " made a fortune";
            }
            else if (balance >= 1000)
            {
                eventString += " did well";
            }
            else if (balance <= -1000)
            {
                eventString += " did poorly";
            }
            else if (balance <= -5000)
            {
                eventString += " lost a fortune";
            }
            else
            {
                eventString += " broke even";
            }
            eventString += " trading goods";
            if (SourceSite != null)
            {
                eventString += " from ";
                eventString += SourceSite.ToLink(link, pov, this);
            }

            if (DestSite != null)
            {
                eventString += " to ";
                eventString += DestSite.ToLink(link, pov, this);
            }

            eventString += PrintParentCollection(link, pov);
            eventString += ".";
            return(eventString);
        }
        public ArtifactCopied(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "artifact_id": Artifact = world.GetArtifact(Convert.ToInt32(property.Value)); break;

                case "dest_site_id": DestSite = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "dest_structure_id": DestStructureId = Convert.ToInt32(property.Value); break;

                case "dest_entity_id": DestEntity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "source_site_id": SourceSite = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "source_structure_id": SourceStructureId = Convert.ToInt32(property.Value); break;

                case "source_entity_id": SourceEntity = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "from_original":
                    FromOriginal   = true;
                    property.Known = true;
                    break;
                }
            }

            if (DestSite != null)
            {
                DestStructure = DestSite.Structures.FirstOrDefault(structure => structure.Id == DestStructureId);
            }

            if (SourceSite != null)
            {
                SourceStructure = SourceSite.Structures.FirstOrDefault(structure => structure.Id == SourceStructureId);
            }

            Artifact.AddEvent(this);
            DestSite.AddEvent(this);
            DestStructure.AddEvent(this);
            DestEntity.AddEvent(this);
            SourceSite.AddEvent(this);
            SourceStructure.AddEvent(this);
            SourceEntity.AddEvent(this);
        }