ScatterGrid class
At most one feature per patch x patch square, placed by hash, never
closer than inset to the square's border. Two features of one grid
therefore stand at least 2 * inset + 1 blocks apart, and every chunk
agrees where each one is from the position alone.
Constructors
- ScatterGrid({required int patch, int inset = 0, required int salt})
-
A grid of
patch-wide squares, spotsinsetin from their borders, rolled withsalt.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- inset → int
-
How far a spot stays from its square's border.
final
- patch → int
-
The side of a square, in blocks.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- salt → int
-
The y salt of the square's hash, so two grids of one seed roll apart.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
spotOf(
int seed, int wx, int wz) → ({int hash, int x, int z}) -
The spot of the square holding (
wx,wz) and the square's hash. A feature stands at (wx,wz) when both equal the spot; the hash is its roll (does it grow, which kind, how tall). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited