Class: IsolatedFaceLedger<TMaterial>
Every per-voxel isolated-face material the world has made, with what it is wearing. The world consults it to answer the census, to hand a face its default the moment that default is painted (a chunk can mesh before the registry's textures land), and to fill what is still unknown.
Type parameters
| Name |
|---|
TMaterial |
Constructors
constructor
• new IsolatedFaceLedger<TMaterial>(): IsolatedFaceLedger<TMaterial>
Type parameters
| Name |
|---|
TMaterial |
Returns
IsolatedFaceLedger<TMaterial>
Accessors
size
• get size(): number
Returns
number
Methods
clear
▸ clear(): void
Returns
void
entries
▸ entries(): { entry: IsolatedFaceEntry<TMaterial> ; key: string }[]
Returns
{ entry: IsolatedFaceEntry<TMaterial> ; key: string }[]
entriesForFace
▸ entriesForFace(blockId, faceName, state?): { entry: IsolatedFaceEntry<TMaterial> ; key: string }[]
The entries for one block face in a given state.
Parameters
| Name | Type |
|---|---|
blockId | number |
faceName | string |
state? | SurfaceState |
Returns
{ entry: IsolatedFaceEntry<TMaterial> ; key: string }[]
get
▸ get(key): IsolatedFaceEntry<TMaterial>
Parameters
| Name | Type |
|---|---|
key | string |
Returns
IsolatedFaceEntry<TMaterial>
note
▸ note(key, entry, state, now): IsolatedFaceEntry<TMaterial>
Record a material's current dress. A material seen for the first time
is registered; one already known only changes state, so a paint after
a seed reads painted and a seed after a paint never demotes it.
Parameters
| Name | Type |
|---|---|
key | string |
entry | Omit<IsolatedFaceEntry<TMaterial>, "state" | "createdAt"> |
state | SurfaceState |
now | number |
Returns
IsolatedFaceEntry<TMaterial>
remove
▸ remove(key): boolean
Parameters
| Name | Type |
|---|---|
key | string |
Returns
boolean