本文整理匯總了C#中Server.Map.GetItemsAtWorldPoint方法的典型用法代碼示例。如果您正苦於以下問題:C# Map.GetItemsAtWorldPoint方法的具體用法?C# Map.GetItemsAtWorldPoint怎麽用?C# Map.GetItemsAtWorldPoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Map
的用法示例。
在下文中一共展示了Map.GetItemsAtWorldPoint方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsValidLocation
public virtual int IsValidLocation( Point3D p, Map m )
{
//Region r = Region.Find( p, m );
// Check if another trap exists in this point
if ( m.GetItemsAtWorldPoint( p ).OfType<BaseFactionTrap>().Any() )
{
return 1075263; // There is already a trap belonging to your faction at this location
}
switch ( AllowedPlacing )
{
case AllowedPlacing.FactionStronghold:
{
StrongholdRegion region = Region.Find( p, m ) as StrongholdRegion;
if ( region != null && region.Faction == m_Faction )
{
return 0;
}
return 1010355; // This trap can only be placed in your stronghold
}
case AllowedPlacing.AnyFactionTown:
{
Town town = Town.FromRegion( Region.Find( p, m ) );
if ( town != null )
{
return 0;
}
return 1010356; // This trap can only be placed in a faction town
}
case AllowedPlacing.ControlledFactionTown:
{
Town town = Town.FromRegion( Region.Find( p, m ) );
if ( town != null && town.Owner == m_Faction )
{
return 0;
}
return 1010357; // This trap can only be placed in a town your faction controls
}
}
return 0;
}