Represents a Quantum player. More...
Inherits IEquatable< PlayerRef >.
Public Member Functions | |
override Boolean | Equals (Object obj) |
Returns true if the PlayerRefs are equal. More... | |
bool | Equals (PlayerRef other) |
Returns true if the PlayerRefs are equal. More... | |
override Int32 | GetHashCode () |
Overrides the default hash function. More... | |
override String | ToString () |
Converts the numeric value of this instance to its equivalent string representation. More... | |
Static Public Member Functions | |
static implicit | operator Int32 (PlayerRef value) |
Converts a PlayerRef to an integer. More... | |
static implicit | operator PlayerRef (Int32 value) |
Converts an integer to a PlayerRef. More... | |
static Boolean | operator!= (PlayerRef a, PlayerRef b) |
Operator override for which checks if two instances of PlayerRef are not equal. More... | |
static Boolean | operator== (PlayerRef a, PlayerRef b) |
Operator override for which checks if two instances of PlayerRef are equal. More... | |
static void | Serialize (void *ptr, IDeterministicFrameSerializer serializer) |
Serializes a PlayerRef into a IDeterministicFrameSerializer to write or read from a frame snapshot. More... | |
Public Attributes | |
Int32 | _index |
PlayerRef backing field. 0 means no player. More... | |
Static Public Attributes | |
const int | SIZE = 4 |
The size of the struct in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed. More... | |
Properties | |
Boolean | IsValid [get] |
Returns true if the player reference is valid (larger than 0). More... | |
static PlayerRef | None [get] |
None player has index 0. More... | |
Represents a Quantum player.
The PlayerRef, in contrast to the player index, is 1-based. The reason is that default(PlayerRef) will return a "null/invalid" player ref struct for convenience. There are automatic cast operators that can cast an int into a PlayerRef.
default(PlayerRef), internally a 0, means NOBODY PlayerRef, internally 1, is the same as player index 0 PlayerRef, internally 2, is the same as player index 1
|
inline |
Returns true
if the PlayerRefs are equal.
|
inline |
Returns true
if the PlayerRefs are equal.
|
inline |
Overrides the default hash function.
|
inline |
Converts the numeric value of this instance to its equivalent string representation.
|
inlinestatic |
Converts a PlayerRef to an integer.
The PlayerRef is 1-based and it will return 0 for player 1 for example.
value | PlayerRef to cast to int. |
|
inlinestatic |
Converts an integer to a PlayerRef.
The PlayerRef is 1-based and will return PlayerRef 1 for input 0 for example.
value | The integer to cast into a PlayerRef. |
Operator override for which checks if two instances of PlayerRef are equal.
true
if the instances are equal.Operator override for which checks if two instances of PlayerRef are not equal.
true
if the instances are not equal.
|
inlinestatic |
|
static |
The size of the struct in-memory inside the Frame data-buffers or stack (when passed as value parameter). Not related to the snapshot payload this occupies, which is bit-packed and compressed.
Int32 Quantum.PlayerRef._index |
PlayerRef backing field. 0 means no player.
|
staticget |
None player has index 0.
|
get |
Returns true
if the player reference is valid (larger than 0).