Position
Position represents the location of an object within a universe, classified into five main categories:
- Void: The object exists nowhere.
- Space: The object is located within a block of space, with optional specific coordinates.
- Object: The object is in relation to another object.
- World: The object has entered a world.
- Outerverse: The object has exited the current universe.
The primary part of a location is called the domain, while the secondary part, called coordinates, provides more specific location details when applicable.
Representation
A position is represented by the following structure:
struct Position {
uint64 domain;
uint64 coord;
}
Fields
Type | Field | Description |
---|---|---|
uint64 | domain | The domain ID, representing the primary part of a location. |
uint64 | coord | The coordinates within the domain, if applicable. |
Domain ID
Each category of location is assigned a unique category ID (cat) and indicated by a letter (indicator). The index specifies the primary part of the location under that category.
Category | Indicator | Cat | Index |
---|---|---|---|
Void | 's' | 0 | index = 0 |
Space | 's' | 0 | index = block ID |
Object | 'o' | 1 | index = set ID |
World | 'w' | 127 | index = world ID |
Outerverse | 'u' | 128 | index = universe ID |
The domain ID is constructed from a combination of cat and index, forming a unique unsigned 64-bit integer:
uint64(cat) << 56 | uint64(index)
Encoding
A position can be encoded as a uint128
:
(uint128(domain) << 64) | uint128(coord)
Written Format
Positions are typically written in dot notation as {letter}.{index}.{coord}. For void positions, you can use void
or 0
, and the trailing 0
can be omitted.
Examples:
Dot Notation | Alternative | Description |
---|---|---|
s.0.0 | void or 0 | The void. |
s.12.34:56 | Block 12, coordinates (34, 56) . | |
o.17.1 | Relation to object 17.1. | |
w.17.0 | w.17 | World 17. |
u.8453.0 | u.8453 | Universe 8453. |