Exemple #1
0
        public PeaceEfforts(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "site": if (Site == null)
                    {
                        Site = world.GetSite(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

                case "topic": Topic = property.Value; break;

                case "source": Source = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "destination": Destination = world.GetEntity(Convert.ToInt32(property.Value)); break;
                }
            }

            Site.AddEvent(this);
            Source.AddEvent(this);
            Destination.AddEvent(this);
        }
        public AgreementMade(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "topic":
                    switch (property.Value)
                    {
                    case "treequota": Topic = AgreementTopic.TreeQuota; break;

                    case "becomelandholder": Topic = AgreementTopic.BecomeLandHolder; break;

                    case "promotelandholder": Topic = AgreementTopic.PromoteLandHolder; break;

                    case "tributeagreement": Topic = AgreementTopic.Tribute; break;

                    case "unknown 9": Topic = AgreementTopic.Tribute; break;

                    default:
                        Topic          = AgreementTopic.Unknown;
                        property.Known = false;
                        break;
                    }
                    break;

                case "source": Source = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "destination": Destination = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "site": if (Site == null)
                    {
                        Site = world.GetSite(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;
                }
            }

            Site.AddEvent(this);
            Source.AddEvent(this);
            if (Source != Destination)
            {
                Destination.AddEvent(this);
            }
        }
        public AgreementConcluded(List <Property> properties, World world) : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "site_id": Site = world.GetSite(Convert.ToInt32(property.Value)); break;

                case "topic":
                    switch (property.Value)
                    {
                    case "treequota": Topic = AgreementTopic.TreeQuota; break;

                    case "becomelandholder": Topic = AgreementTopic.BecomeLandHolder; break;

                    case "promotelandholder": Topic = AgreementTopic.PromoteLandHolder; break;

                    default:
                        Topic = AgreementTopic.Unknown;
                        world.ParsingErrors.Report("Unknown Agreement Topic: " + property.Value);
                        break;
                    }
                    break;

                case "source": Source = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "destination": Destination = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "site": if (Site == null)
                    {
                        Site = world.GetSite(Convert.ToInt32(property.Value));
                    }
                    else
                    {
                        property.Known = true;
                    } break;

                case "result": Result = Convert.ToInt32(property.Value); break;
                }
            }

            Site.AddEvent(this);
            Source.AddEvent(this);
            Destination.AddEvent(this);
        }
Exemple #4
0
        public Merchant(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "source": Source = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "destination": Destination = world.GetEntity(Convert.ToInt32(property.Value)); break;

                case "site": Site = world.GetSite(Convert.ToInt32(property.Value)); break;
                }
            }
            Source.AddEvent(this);
            Destination.AddEvent(this);
            Site.AddEvent(this);
        }
Exemple #5
0
        public Merchant(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "source":
                case "trader_entity_id":
                    Source = world.GetEntity(Convert.ToInt32(property.Value));
                    break;

                case "destination":
                case "depot_entity_id":
                    Destination = world.GetEntity(Convert.ToInt32(property.Value));
                    break;

                case "site":
                    Site = world.GetSite(Convert.ToInt32(property.Value));
                    break;

                case "site_id":
                    // points to wrong site
                    property.Known = true;
                    break;

                case "seizure": Seizure = true; property.Known = true; break;

                case "lost_value": LostValue = true; property.Known = true; break;

                case "hardship": HardShip = true; property.Known = true; break;

                case "all_dead": AllDead = true; property.Known = true; break;
                }
            }
            Source.AddEvent(this);
            Destination.AddEvent(this);
            Site.AddEvent(this);
        }
Exemple #6
0
        public Merchant(List <Property> properties, World world)
            : base(properties, world)
        {
            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "source":
                case "trader_entity_id":
                    Entity source = world.GetEntity(Convert.ToInt32(property.Value));
                    if (Source == null)
                    {
                        Source = source;
                    }
                    else if (Source != source)
                    {
                        property.Known = false;
                    }
                    else
                    {
                        property.Known = true;
                    }
                    break;

                case "destination":
                case "depot_entity_id":
                    Entity destination = world.GetEntity(Convert.ToInt32(property.Value));
                    if (Destination == null)
                    {
                        Destination = destination;
                    }
                    else if (Destination != destination)
                    {
                        property.Known = false;
                    }
                    else
                    {
                        property.Known = true;
                    }
                    break;

                case "site":
                    Site = world.GetSite(Convert.ToInt32(property.Value));
                    break;

                case "site_id":
                    // points to wrong site
                    property.Known = true;
                    break;

                case "seizure":
                    Seizure        = true;
                    property.Known = true;
                    break;

                case "lost_value":
                    LostValue      = true;
                    property.Known = true;
                    break;
                }
            }
            Source.AddEvent(this);
            Destination.AddEvent(this);
            Site.AddEvent(this);
        }