◆ CascadingBlock()
essentials.Blocks.Physics.CascadingBlock.CascadingBlock |
( |
Vector3i [] |
cascade, |
|
|
bool |
infinite |
|
) |
| |
|
protected |
16 this._cascade = cascade;
17 this._infinite = infinite;
◆ BuildCascade()
static CascadingBlock essentials.Blocks.Physics.CascadingBlock.BuildCascade |
( |
int |
size, |
|
|
bool |
infinite = false |
|
) |
| |
|
static |
47 var cascade =
new List<Vector3i>();
49 for (
int l=0; l<=size; ++l)
51 for (
int x=-l; x<=l; ++x)
53 for (
int y=-l; y<=l; ++y)
56 if (!cascade.Contains(pt))
CascadingBlock(Vector3i[] cascade, bool infinite)
Definition: CascadingBlock.cs:14
static readonly Vector3i
All directions, including diagnols
Definition: Vector3i.cs:111
A class representing a 3D coordinate of integers
Definition: Vector3i.cs:13
◆ Simulate() [1/2]
Attribute: i
;
Attribute: targetCoord
;
Implements essentials.Blocks.Physics.IBlockPhysics.
23 for (
int i=0; i<_cascade.Length; ++i)
25 var targetCoord = src.
Coordinate + _cascade[i];
26 var target = world[targetCoord];
28 if (target.Generated && !target.Block.Solid && !target.Block.IsLiquid && target.Block != src.
Block)
30 target.Block = spawnBlock ?? src.
Block;
32 src.
Block = world.BlockLookup.EmptyBlock;
new IBlock Block
Block setter for this position
Definition: IWorldBlock.cs:14
Vector3i Coordinate
Coordinate
Definition: IWorldReadonlyBlock.cs:24
◆ Simulate() [2/2]
bool essentials.Blocks.Physics.CascadingBlock.Simulate |
( |
IWorld |
world, |
|
|
IWorldBlock |
src |
|
) |
| |
The documentation for this class was generated from the following file: