本文整理汇总了C#中Server.MultiComponentList.RemoveXYZH方法的典型用法代码示例。如果您正苦于以下问题:C# MultiComponentList.RemoveXYZH方法的具体用法?C# MultiComponentList.RemoveXYZH怎么用?C# MultiComponentList.RemoveXYZH使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.MultiComponentList
的用法示例。
在下文中一共展示了MultiComponentList.RemoveXYZH方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteStairs
public static bool DeleteStairs( MultiComponentList mcl, int id, int x, int y, int z )
{
int ax = x + mcl.Center.X;
int ay = y + mcl.Center.Y;
if ( ax < 0 || ay < 0 || ax >= mcl.Width || ay >= (mcl.Height - 1) || z < 7 || ((z - 7) % 5) != 0 )
return false;
if ( IsStairBlock( id ) )
{
Tile[] tiles = mcl.Tiles[ax][ay];
for ( int i = 0; i < tiles.Length; ++i )
{
Tile tile = tiles[i];
if ( tile.Z == (z + 5) )
{
id = tile.ID;
z = tile.Z;
if ( !IsStairBlock( id ) )
break;
}
}
}
int dir = 0;
if ( !IsStair( id, ref dir ) )
return false;
int height = ((z - 7) % 20) / 5;
int xStart, yStart;
int xInc, yInc;
switch ( dir )
{
default:
case 0: // North
{
xStart = x;
yStart = y + height;
xInc = 0;
yInc = -1;
break;
}
case 1: // West
{
xStart = x + height;
yStart = y;
xInc = -1;
yInc = 0;
break;
}
case 2: // South
{
xStart = x;
yStart = y - height;
xInc = 0;
yInc = 1;
break;
}
case 3: // East
{
xStart = x - height;
yStart = y;
xInc = 1;
yInc = 0;
break;
}
}
int zStart = z - (height * 5);
for ( int i = 0; i < 4; ++i )
{
x = xStart + (i * xInc);
y = yStart + (i * yInc);
for ( int j = 0; j <= i; ++j )
mcl.RemoveXYZH( x, y, zStart + (j * 5), 5 );
ax = x + mcl.Center.X;
ay = y + mcl.Center.Y;
if ( ax >= 1 && ax < mcl.Width && ay >= 1 && ay < mcl.Height - 1 )
{
Tile[] tiles = mcl.Tiles[ax][ay];
bool hasBaseFloor = false;
for ( int j = 0; !hasBaseFloor && j < tiles.Length; ++j )
hasBaseFloor = ( tiles[j].Z == 7 && (tiles[j].ID & 0x3FFF) != 1 );
if ( !hasBaseFloor )
mcl.Add( 0x31F4, x, y, 7 );
}
}
//.........这里部分代码省略.........