An entity id uint with type information. More...
Public Types | |
| enum class | Types { UNASSIGNED = 0 , SERVER_ID = 1 , TEMPORARY_SPAWN_ID = 2 } |
| Id types More... | |
Public Member Functions | |
| ksEntityId (uint id) | |
| Constructor More... | |
| bool | Equals (ksEntityId other) |
| Checks if this id is equal to another. More... | |
| override bool | Equals (object obj) |
| Checks if this id is equal to an object. More... | |
| override int | GetHashCode () |
| Gets a hash code. More... | |
| override string | ToString () |
| Converts the id number to a string. More... | |
| void | Serialize (ksStreamBuffer buffer) |
| Serializes the id to a buffer. More... | |
| void | Deserialize (ksStreamBuffer buffer) |
| Deserializes the id from a buffer. More... | |
Static Public Member Functions | |
| static implicit | operator ksEntityId (uint id) |
| Implicit conversion from uint. More... | |
| static implicit | operator uint (ksEntityId id) |
| Implicit conversion to uint. More... | |
| static implicit | operator ksEntityId (ksMultiType value) |
| Implicit conversion from ksMultiType. More... | |
| static implicit | operator ksMultiType (ksEntityId id) |
| Implicit conversion to ksMultiType. More... | |
| static bool | operator== (ksEntityId lhs, ksEntityId rhs) |
| Checks if two ids are equal. More... | |
| static bool | operator!= (ksEntityId lhs, ksEntityId rhs) |
| Checks if two ids are not equal. More... | |
| static bool | operator> (ksEntityId lhs, ksEntityId rhs) |
| Checks if lhs is greater than rhs . More... | |
| static bool | operator< (ksEntityId lhs, ksEntityId rhs) |
| Checks if lhs is less than rhs . More... | |
Static Public Attributes | |
| const uint | SPAWN_ID_START = 1u << 31 |
| The lowest spawn id value. More... | |
Properties | |
| Types? | Type [get] |
| Id type More... | |
An entity id uint with type information.
The type can be a server entity id or a temporary spawn id that players use to identify entities they spawned before the server confirms the spawn and sends the server entity id. Internally the id is just a uint and the type is determined by which bits are set. If the highest bit is set, it's a temporary spawn id, otherwise it's a server entity id, unless the value is zero in which case it is invalid. Temporary spawn ids are not enough to identify an entity on the server; the id of the player who spawned the entity is also needed.
|
strong |
Id types
| KS.Reactor.ksEntityId.ksEntityId | ( | uint | id | ) |
Constructor
| id | Id |
| void KS.Reactor.ksEntityId.Deserialize | ( | ksStreamBuffer | buffer | ) |
Deserializes the id from a buffer.
| buffer | Buffer to deserialize from. |
Implements ksISerializable.
| bool KS.Reactor.ksEntityId.Equals | ( | ksEntityId | other | ) |
Checks if this id is equal to another.
| other |
| override bool KS.Reactor.ksEntityId.Equals | ( | object | obj | ) |
Checks if this id is equal to an object.
| obj |
| override int KS.Reactor.ksEntityId.GetHashCode | ( | ) |
Gets a hash code.
|
static |
Implicit conversion from ksMultiType.
| value | Value |
|
static |
Implicit conversion from uint.
| id | Id |
|
static |
Implicit conversion to ksMultiType.
| id | Id |
|
static |
Implicit conversion to uint.
| id | Id |
|
static |
Checks if two ids are not equal.
| lhs | |
| rhs |
|
static |
Checks if lhs is less than rhs .
| lhs | |
| rhs |
|
static |
Checks if two ids are equal.
| lhs | |
| rhs |
|
static |
Checks if lhs is greater than rhs .
| lhs | |
| rhs |
| void KS.Reactor.ksEntityId.Serialize | ( | ksStreamBuffer | buffer | ) |
| override string KS.Reactor.ksEntityId.ToString | ( | ) |
Converts the id number to a string.
If it is zero, the string "Unassigned" is returned.
|
static |
The lowest spawn id value.
|
get |
Id type