本文整理匯總了C#中fCraft.Map.QueueUpdate方法的典型用法代碼示例。如果您正苦於以下問題:C# Map.QueueUpdate方法的具體用法?C# Map.QueueUpdate怎麽用?C# Map.QueueUpdate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fCraft.Map
的用法示例。
在下文中一共展示了Map.QueueUpdate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: removal
public static void removal(ConcurrentDictionary<String, Vector3I> bullets, Map map)
{
foreach (Vector3I bp in bullets.Values)
{
map.QueueUpdate(new BlockUpdate(null,
(short)bp.X,
(short)bp.Y,
(short)bp.Z,
Block.Air));
Vector3I removed;
bullets.TryRemove(bp.ToString(), out removed);
}
}
示例2: DrawOneBlock
//stolen from BuildingCommands
#region DrawOneBlock
static void DrawOneBlock ( Player player, Map map, Block drawBlock, Vector3I coord,
BlockChangeContext context, ref int blocks, ref int blocksDenied, fCraft.Drawing.UndoState undoState ) {
if ( map == null ) return;
if ( player == null ) throw new ArgumentNullException( "player" );
if ( !map.InBounds( coord ) ) return;
Block block = map.GetBlock( coord );
if ( block == drawBlock ) return;
if ( player.CanPlace( map, coord, drawBlock, context ) != CanPlaceResult.Allowed ) {
blocksDenied++;
return;
}
map.QueueUpdate( new BlockUpdate( null, coord, drawBlock ) );
Player.RaisePlayerPlacedBlockEvent( player, map, coord, block, drawBlock, context );
if ( !undoState.IsTooLargeToUndo ) {
if ( !undoState.Add( coord, block ) ) {
player.Message( "NOTE: This draw command is too massive to undo." );
player.LastDrawOp = null;
}
}
blocks++;
}