TShockAPI.DB.Region.InArea C# (CSharp) Method

InArea() public method

Checks if a given point is in the region's area
public InArea ( Rectangle point ) : bool
point Rectangle Point to check
return bool
        public bool InArea(Rectangle point)
        {
            return InArea(point.X, point.Y);
        }

Same methods

Region::InArea ( int x, int y ) : bool

Usage Example

コード例 #1
0
        public bool TryGetHouseRegionAtPlayer(TSPlayer player, out string owner, out int houseIndex, out Region region)
        {
            Contract.Requires<ArgumentNullException>(player != null);

              for (int i = 0; i < TShock.Regions.Regions.Count; i++) {
            region = TShock.Regions.Regions[i];
            if (region.InArea(player.TileX, player.TileY) && this.TryGetHouseRegionData(region.Name, out owner, out houseIndex))
              return true;
              }

              owner = null;
              region = null;
              houseIndex = -1;
              return false;
        }