本文整理汇总了C#中Rectangle2D.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle2D.Contains方法的具体用法?C# Rectangle2D.Contains怎么用?C# Rectangle2D.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rectangle2D
的用法示例。
在下文中一共展示了Rectangle2D.Contains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsDungeonRegion
private bool IsDungeonRegion(Mobile from)
{
if (from == null)
return false;
Map map = from.Map;
Region reg = from.Region;
Rectangle2D bounds = new Rectangle2D(0, 0, 5114, 4100);
if ((map == Map.Felucca || map == Map.Trammel) && bounds.Contains(new Point2D(from.X, from.Y)))
return false;
return reg != null && (reg.IsPartOf(typeof(Server.Regions.DungeonRegion)) || map == Map.Ilshenar);
}
示例2: INRECTANGLE
public static bool INRECTANGLE(TriggerObject trigObject, IPoint2D testObject, Rectangle2D rectangle)
{
return testObject != null && rectangle.Contains(testObject);
}
示例3: GetSwabTarget
private Point2D GetSwabTarget( Corpse corpse )
{
Point2D target = Point2D.Zero;
Rectangle2D bounds = new Rectangle2D(X + Components.Min.X, Y + Components.Min.Y, Components.Width, Components.Height);
Tour tour = delegate( Map map, int x, int y )
{
int xLoc = corpse.X + x;
int yLoc = corpse.Y + y;
if( bounds.Contains(new Point2D(xLoc, yLoc)) )
return false;
LandTile tile = map.Tiles.GetLandTile(xLoc, yLoc);
int[] waterTiles = Fishing.WaterTiles;
for( int i = 0; i < waterTiles.Length; i++ )
{
if( tile.ID == waterTiles[i] )
{
target = new Point2D(xLoc, yLoc);
return true;
}
}
return false;
};
Search.Spiral(this.Map, 1, SearchDirection.Outwards, false, tour);
return target;
}
示例4: VerifyPlacement
public bool VerifyPlacement( Mobile from, Rectangle2D area )
{
if( !from.CheckAlive() )
return false;
foreach( Item i in from.GetItemsInRange( 12 ) )
{
if( (i is TravelTent || i is TentAddon) && area.Contains( i ) )
return false;
}
Region region = Region.Find( from.Location, from.Map );
if( from.AccessLevel >= AccessLevel.GameMaster || region.AllowHousing( from, from.Location ) )
return true;
else if( !from.Map.CanFit( from.Location, 16 ) )
return false;
else if( region is TreasureRegion )
return false;
return (from.AccessLevel >= AccessLevel.GameMaster || region.AllowHousing( from, from.Location ));
}