Photon Quantum 3.0.0

Public Member Functions | Static Public Member Functions | List of all members
Photon.Deterministic.InputSetMask Struct Reference

The input mask is a utility struct to keep track of which players are included in a set of inputs. Max player count supported is 128. Internally the mask is split into two ulongs. More...

Public Member Functions

 InputSetMask ()
 Create an empty mask. More...
 
 InputSetMask (int index)
 Constructor using a single player index. More...
 
void Add (int index)
 Add a player index to the mask. More...
 
InputSetMask Combine (InputSetMask other)
 Combine two masks. An enabled player flag takes precedence. More...
 
bool Contains (int index)
 Check if a player is included in the mask. More...
 
override bool Equals (Object other)
 Equals method. More...
 
override int GetHashCode ()
 Returns a unique hashcode for the mask. More...
 
InputSetMask Intersects (InputSetMask other)
 Intersect two masks and return a new mask with the players that are included in both masks. More...
 
InputSetMask Inverse ()
 Inverse a mask. More...
 
void Remove (int index)
 Remove a player index from the mask. More...
 
void Serialize (BitStream stream, int playerLength)
 Serialize the mask to a bitstream. More...
 

Static Public Member Functions

static InputSetMask AllPlayersMask ()
 Create a mask that includes all players. More...
 
static bool operator!= (InputSetMask mask1, InputSetMask mask2)
 Un-equals operator. More...
 
static bool operator== (InputSetMask mask1, InputSetMask mask2)
 Equals operator. More...
 

Detailed Description

The input mask is a utility struct to keep track of which players are included in a set of inputs. Max player count supported is 128. Internally the mask is split into two ulongs.

Constructor & Destructor Documentation

◆ InputSetMask() [1/2]

Photon.Deterministic.InputSetMask.InputSetMask ( int  index)
inline

Constructor using a single player index.

Parameters
indexPlayer index

◆ InputSetMask() [2/2]

Photon.Deterministic.InputSetMask.InputSetMask ( )
inline

Create an empty mask.

Member Function Documentation

◆ AllPlayersMask()

static InputSetMask Photon.Deterministic.InputSetMask.AllPlayersMask ( )
inlinestatic

Create a mask that includes all players.

Returns
Resulting mask

◆ Contains()

bool Photon.Deterministic.InputSetMask.Contains ( int  index)
inline

Check if a player is included in the mask.

Parameters
indexPlayer index
Returns
true if the player is included

◆ Combine()

InputSetMask Photon.Deterministic.InputSetMask.Combine ( InputSetMask  other)
inline

Combine two masks. An enabled player flag takes precedence.

Parameters
otherOther mask
Returns
A new mask all players flagged.

◆ Intersects()

InputSetMask Photon.Deterministic.InputSetMask.Intersects ( InputSetMask  other)
inline

Intersect two masks and return a new mask with the players that are included in both masks.

Parameters
otherOther mask
Returns
A new mask with players included in both mask

◆ Inverse()

InputSetMask Photon.Deterministic.InputSetMask.Inverse ( )
inline

Inverse a mask.

Returns
A new mask with inverted player flags

◆ Add()

void Photon.Deterministic.InputSetMask.Add ( int  index)
inline

Add a player index to the mask.

Parameters
indexPlayer index

◆ Remove()

void Photon.Deterministic.InputSetMask.Remove ( int  index)
inline

Remove a player index from the mask.

Parameters
indexPlayer index

◆ Serialize()

void Photon.Deterministic.InputSetMask.Serialize ( BitStream  stream,
int  playerLength 
)
inline

Serialize the mask to a bitstream.

Parameters
streamStream to write or read from
playerLengthThe player length to optimize the amount of memory used.

◆ operator==()

static bool Photon.Deterministic.InputSetMask.operator== ( InputSetMask  mask1,
InputSetMask  mask2 
)
inlinestatic

Equals operator.

Parameters
mask1Mask 1
mask2Mask 2
Returns
true if both mask are equal

◆ operator!=()

static bool Photon.Deterministic.InputSetMask.operator!= ( InputSetMask  mask1,
InputSetMask  mask2 
)
inlinestatic

Un-equals operator.

Parameters
mask1Mask 1
mask2Mask 2
Returns
true if the masks are different

◆ Equals()

override bool Photon.Deterministic.InputSetMask.Equals ( Object  other)
inline

Equals method.

Parameters
otherOther mask
Returns
true if both masks are equal

◆ GetHashCode()

override int Photon.Deterministic.InputSetMask.GetHashCode ( )
inline

Returns a unique hashcode for the mask.

Returns
Hashcode