本文整理汇总了C#中Command.NextBlock方法的典型用法代码示例。如果您正苦于以下问题:C# Command.NextBlock方法的具体用法?C# Command.NextBlock怎么用?C# Command.NextBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command.NextBlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadParams
public override bool ReadParams( Command cmd ) {
if( cmd.HasNext ) {
ReplacementBlock = cmd.NextBlock( Player );
if( ReplacementBlock == Block.Undefined ) return false;
}
Brush = this;
return true;
}
示例2: ReadParams
public override bool ReadParams( Command cmd ) {
if( Player.GetCopyInformation() == null ) {
Player.Message( "Nothing to paste! Copy something first." );
return false;
}
List<Block> blocks = new List<Block>();
while( cmd.HasNext ) {
Block block = cmd.NextBlock( Player );
if( block == Block.Undefined ) return false;
blocks.Add( block );
}
if( blocks.Count > 0 ) {
Blocks = blocks.ToArray();
} else if( Not ) {
Player.Message( "PasteNot requires at least 1 block." );
return false;
}
Brush = this;
return true;
}
示例3: MakeBrush
public IBrush MakeBrush([NotNull] Player player, Command cmd)
{
if (player == null) throw new ArgumentNullException("player");
if (cmd == null) throw new ArgumentNullException("cmd");
if (!cmd.HasNext)
{
if (player.LastUsedBlockType != (Block)255)
return new DiagonalBrush(new[] { player.LastUsedBlockType });
else return new DiagonalBrush(new[] { Block.Stone });
}
Stack<Block> temp = new Stack<Block>();
while (cmd.HasNext)
{
Block block = cmd.NextBlock(player);
if (block == Block.Undefined) return null;
temp.Push(block);
}
return new DiagonalBrush(temp.ToArray());
}