Example #1
0
        public ArtifactLost(List <Property> properties, World world) : base(properties, world)
        {
            int sitePropertyId = -1;

            foreach (Property property in properties)
            {
                switch (property.Name)
                {
                case "artifact_id": Artifact = world.GetArtifact(Convert.ToInt32(property.Value)); break;

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

                case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break;

                case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break;

                case "site_property_id": sitePropertyId = Convert.ToInt32(property.Value); break;
                }
            }

            if (Site != null && sitePropertyId != -1)
            {
                SiteProperty = Site.SiteProperties.FirstOrDefault(sp => sp.Id == sitePropertyId);
            }
            Artifact.AddEvent(this);
            Site.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }
Example #2
0
    // Use this for initialization
    void Start()
    {
        GameObject lro = new GameObject();

        boundaryLine = lro.AddComponent <LineRenderer>();
        boundaryLine.positionCount = 4;
        boundaryLine.SetWidth(3, 3);

        particleSystem = new SGPlaningParticleSystem();
        siteProp       = new SiteProperty();

        pm3        = new PlaningMatrix3(ref siteProp);
        pm3.camera = calCamera;
        pm3.AddType("A", new Vector3(45, 100, 20), 1.2f);
        pm3.AddType("B", new Vector3(45, 60, 20), 1.6f);
        pm3.AddType("C", new Vector3(45, 9, 20), 1.8f);
        //pm3.AddType("A", 1200, 100, 30, 1.2f);
        //pm3.AddType("B", 1200, 50, 15, 1.5f);
        //pm3.AddType("C", 800, 40, 8,1.8f);

        pm3.genGrid();

        UpdateSiteParam();

        AssignSliderAction(sldSiteW);
        AssignSliderAction(sldSiteH);
        AssignSliderAction(sldSitePlotRatio);
        AssignSliderAction(sldSiteCoverage);

        //updateDesign();
    }
Example #3
0
 public PlaningMatrix3(ref SiteProperty siteProp)
 {
     buildingTypes  = new List <BuildingType>();
     schemes        = new List <PlaningScheme>();
     this.siteProp  = siteProp;
     recommendation = new Recommendation(this);
 }
Example #4
0
        public override string Print(bool link = true, DwarfObject pov = null)
        {
            string eventString = GetYearTime();

            if (AcquirerHf != null)
            {
                eventString += AcquirerHf?.ToLink(link, pov, this);
                if (AcquirerEntity != null)
                {
                    eventString += " of ";
                }
            }
            else if (AcquirerEntity != null)
            {
                eventString += AcquirerEntity.ToLink(link, pov, this);
            }
            else
            {
                eventString += "Someone ";
            }
            if (PurchasedUnowned)
            {
                eventString += " purchased ";
            }
            else if (Inherited)
            {
                eventString += " inherited ";
            }
            else if (RebuiltRuined)
            {
                eventString += " rebuilt ";
            }
            else
            {
                eventString += " acquired ";
            }

            eventString += SiteProperty.Print(link, pov);
            if (Site != null)
            {
                eventString += " in ";
                eventString += Site.ToLink(link, pov, this);
            }

            if (LastOwnerHf != null)
            {
                eventString += " formerly owned by ";
                eventString += LastOwnerHf.ToLink(link, pov, this);
            }

            eventString += PrintParentCollection(link, pov);
            eventString += ".";
            return(eventString);
        }
Example #5
0
        public ArtifactFound(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 "hist_figure_id":
                    HistoricalFigure = world.GetHistoricalFigure(Convert.ToInt32(property.Value));
                    break;

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

                case "site_property_id":
                    SitePropertyId = Convert.ToInt32(property.Value);
                    break;

                case "structure_id":
                    StructureId = Convert.ToInt32(property.Value);
                    break;

                case "unit_id":
                    UnitId = Convert.ToInt32(property.Value);
                    if (UnitId != -1)
                    {
                        property.Known = false;
                    }
                    break;

                case "subregion_id": Region = world.GetRegion(Convert.ToInt32(property.Value)); break;

                case "feature_layer_id": UndergroundRegion = world.GetUndergroundRegion(Convert.ToInt32(property.Value)); break;
                }
            }

            if (Site != null)
            {
                Structure    = Site.Structures.FirstOrDefault(structure => structure.Id == StructureId);
                SiteProperty = Site.SiteProperties.FirstOrDefault(sp => sp.Id == SitePropertyId);
            }
            Artifact.AddEvent(this);
            HistoricalFigure.AddEvent(this);
            Site.AddEvent(this);
            Structure.AddEvent(this);
            Region.AddEvent(this);
            UndergroundRegion.AddEvent(this);
        }