本文整理汇总了C#中fCraft.World.AddPhysicsTask方法的典型用法代码示例。如果您正苦于以下问题:C# World.AddPhysicsTask方法的具体用法?C# World.AddPhysicsTask怎么用?C# World.AddPhysicsTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fCraft.World
的用法示例。
在下文中一共展示了World.AddPhysicsTask方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitBlock
public bool VisitBlock(World world, Vector3I pos, Block block, Player owner, ref int restDistance, IList<BlockUpdate> updates, Block sending)
{
if (Block.Air != block && Block.Water != block) //explode it
{
updates.Add(new BlockUpdate(null, pos, Block.TNT));
world.AddPhysicsTask(new TNTTask(world, pos, owner, false, true), 0);
restDistance = 0;
return false;
}
return true;
}
示例2: HitPlayer
public void HitPlayer(World world, Vector3I pos, Player hitted, Player by, ref int restDistance, IList<BlockUpdate> updates)
{
hitted.Kill(world, String.Format("{0}&S was torn to pieces by {1}", hitted.ClassyName, hitted.ClassyName == by.ClassyName ? "theirself" : by.ClassyName));
updates.Add(new BlockUpdate(null, pos, Block.TNT));
world.AddPhysicsTask(new TNTTask(world, pos, by, false, true), 0);
restDistance = 0;
}
示例3: VisitBlock
//true if not stopped
public bool VisitBlock(World world, Vector3I pos, Block block, Player owner, ref int restDistance, IList<BlockUpdate> updates, Block sending)
{
if (Block.TNT == block) //explode it
{
world.AddPhysicsTask(new TNTTask(world, pos, owner, false, true), _r.Next(150, 300));
}
if (Block.Air != block && Block.Water != block && Block.Lava != block)
if (owner.CanPlace(world.Map, pos, Block.Wood, BlockChangeContext.Manual) == CanPlaceResult.Allowed)
updates.Add(new BlockUpdate(null, pos, Block.Air));
return true;
}