本文整理汇总了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;
}