예제 #1
0
    /// <summary>
    /// Chooses a point of interest by type
    /// </summary>
    /// <param name="poi"></param>
    void ChoosePointOfInterest(POIType poi)
    {
        List <PointOfInterest> pointsOfSelectedType = new List <PointOfInterest>();

        for (int i = 0; i < points.Length; i++)
        {
            if (points[i].navPointOfInterest == poi && !points[i].occupied)
            {
                pointsOfSelectedType.Add(points[i]);
            }
        }

        if (currentPOI != null)
        {
            currentPOI.occupied = false;
        }

        if (pointsOfSelectedType.Count == 0)
        {
            state = BrainStates.Lingering;
            return;
        }

        currentPOI = pointsOfSelectedType[Random.Range(0, pointsOfSelectedType.Count)];
        agent.SetDestination(currentPOI.transform.position);
        currentPOI.occupied = true;
        state = BrainStates.Moving;
    }
예제 #2
0
파일: Form1.cs 프로젝트: sesmith2k/SaltMaps
 private void AddPOI(Point p, POIType type)
 {
     var mp = CalulateMapPosition(p.X, p.Y);
     mp.PoiType = type;
     mapPoints.Add(mp);
     AddPOIToMap(mp);
     btnSave.Enabled = true;
 }
예제 #3
0
파일: Form1.cs 프로젝트: sesmith2k/SaltMaps
        private void AddPOI(Point p, POIType type)
        {
            var mp = CalulateMapPosition(p.X, p.Y);

            mp.PoiType = type;
            mapPoints.Add(mp);
            AddPOIToMap(mp);
            btnSave.Enabled = true;
        }
예제 #4
0
 public MapPoint(int x, int y, bool IsXEast, bool IsYSouth, string name, POIType type, string notes)
 {
     X = x;
     Y = y;
     this.IsX_East = IsXEast;
     this.IsY_South = IsYSouth;
     this.Name = name;
     this.PoiType = type;
     this.Notes = notes;
 }
예제 #5
0
 public MapPoint(int x, int y, bool IsXEast, bool IsYSouth, string name, POIType type, string notes)
 {
     X              = x;
     Y              = y;
     this.IsX_East  = IsXEast;
     this.IsY_South = IsYSouth;
     this.Name      = name;
     this.PoiType   = type;
     this.Notes     = notes;
 }
예제 #6
0
        public PointOfInterest(string name, POIType t, int hexNum, double offsetX = 0, double offsetY = 0, double textOffsetX = 0, double textOffsetY = 0)
        {
            l = new List <System.Windows.FrameworkElement>();

            this.name        = name;
            this.pointType   = t;
            this.hexNum      = hexNum;
            this.hidden      = true;
            this.offsetX     = offsetX;
            this.offsetY     = offsetY;
            this.textOffsetX = textOffsetX;
            this.textOffsetY = textOffsetY;

            pixelLoc = Hexagon.HexNumberToPos(hexNum);

            CreateElementList();
        }
예제 #7
0
 public POI(POIType type, POIManager pm)
 {
     this.type   = type;
     this.status = POIStatus.Hidden;
     this.pm     = pm;
     if (status == POIStatus.Hidden)
     {
         Prefab = pm.gm.poiPrefabs[0];
     }
     else if (status == POIStatus.Revealed && type == POIType.Victim)
     {
         Prefab = pm.gm.poiPrefabs[1];
     }
     else if (status == POIStatus.Treated && type == POIType.Victim)
     {
         Prefab = pm.gm.poiPrefabs[2];
     }
 }
예제 #8
0
        public void Analyze()
        {
            Debug.Log("analyzing blueprint {0} with options {1}", blueprint, options);
            blueprint.FindRooms();
            Debug.Log("Rooms found");
            BlueprintPreprocessor.ProcessBlueprint(blueprint, options);
            Debug.Log("Blueprint processed");

            result            = new BlueprintAnalyzerResult();
            result.totalArea  = blueprint.width * blueprint.height;
            result.roomsCount = blueprint.roomAreas.Count() - 2;

            result.internalArea = 0;
            for (int index = 2; index < blueprint.roomAreas.Count; index++)
            {
                result.internalArea += blueprint.roomAreas[index];
            }

            blueprint.UpdateBlueprintStats(includeCost: true);
            Debug.Log(Debug.Analyzer, "Analyzing map");
            for (int y = 0; y < blueprint.height; y++)
            {
                for (int x = 0; x < blueprint.width; x++)
                {
                    List <ItemTile> tiles = blueprint.itemsMap[x, y] ?? new List <ItemTile>();
                    foreach (ItemTile itemTile in tiles)
                    {
                        ProcessTile(itemTile, new IntVec3(x, 0, y));
                    }
                }
            }

            this.mannableCount = result.mannableCount;
            determinedType     = supposedType();
            Debug.Log(Debug.Analyzer, "Type is {0} by {1}", determinedType, result.ToString());
        }
예제 #9
0
        static TechLevel MinTechLevelForPOIType(POIType poiType)
        {
            switch (poiType)
            {
            case POIType.Camp:
                return(TechLevel.Neolithic);

            case POIType.Outpost:
            case POIType.Storage:
                return(TechLevel.Medieval);

            case POIType.Factory:
            case POIType.Research:
            case POIType.City:
            case POIType.Communication:
            case POIType.Stronghold:
            case POIType.MilitaryBaseLarge:
            case POIType.MilitaryBaseSmall:
                return(TechLevel.Industrial);

            default:
                return(TechLevel.Undefined);
            }
        }
예제 #10
0
 public static string ImageSourceFromPOIType(POIType type)
 {
     return "/Images/POIType/" + type.ToString().ToLower() + ".png";
 }
예제 #11
0
        public POICollection GetPOIList(int placeID, POIType? poiType)
        {
            var request = new RestRequest { Resource = "places/{placeID}/pois" };
            request.AddParameter("placeID", placeID, ParameterType.UrlSegment);

            if (poiType != null)
                request.AddParameter("poi_type", poiType);

            return Execute<POICollection>(request);
        }
예제 #12
0
        public virtual POICollection GetPOIList(Place place, POIType? poiType)
        {
            var request = new RestRequest { Resource = "bounding_boxes/{north},{south},{east},{west}/pois" };
            request.AddParameter("north", place.Northlatitude, ParameterType.UrlSegment);
            request.AddParameter("south", place.Southlatitude, ParameterType.UrlSegment);
            request.AddParameter("east", place.Eastlongitude, ParameterType.UrlSegment);
            request.AddParameter("west", place.Westlongitude, ParameterType.UrlSegment);

            if (poiType != null)
                request.AddParameter("poi_type", poiType);

            return Execute<POICollection>(request);
        }
예제 #13
0
 public static string Display(this POIType type)
 {
     return(AppResources.ResourceManager.GetString(type.ToString(), AppResources.Culture));
 }
예제 #14
0
 public static string ImageSourceFromPOIType(POIType type)
 {
     return("/Images/POIType/" + type.ToString().ToLower() + ".png");
 }