Infohazard.Core 1.4.1
Infohazard Core Utility Library
Loading...
Searching...
No Matches
Infohazard.Core.TagMask Struct Reference

Used to select tags in the inspector, including the ability to select multiple tags. More...

Public Member Functions

 TagMask (long value)
 Initialize a new TagMask with the given value. More...
 
override string ToString ()
 
bool Equals (TagMask other)
 
override bool Equals (object obj)
 
override int GetHashCode ()
 

Static Public Member Functions

static implicit operator long (TagMask mask)
 Convert a TagMask to a long. More...
 
static implicit operator TagMask (long mask)
 Convert a long to a TagMask. More...
 
static TagMask operator& (in TagMask lhs, in TagMask rhs)
 Apply bitwise AND operator to two TagMasks. More...
 
static TagMask operator& (TagMask lhs, long rhs)
 Apply bitwise AND operator to a TagMask and a long. More...
 
static long operator& (long lhs, TagMask rhs)
 Apply bitwise AND operator to a long and a TagMask. More...
 
static TagMask operator| (TagMask lhs, TagMask rhs)
 Apply bitwise OR operator to a TagMask and a TagMask. More...
 
static TagMask operator| (TagMask lhs, long rhs)
 Apply bitwise OR operator to a TagMask and a long. More...
 
static long operator| (long lhs, TagMask rhs)
 Apply bitwise OR operator to a long and a TagMask. More...
 
static TagMask operator^ (TagMask lhs, TagMask rhs)
 Apply bitwise XOR operator to a TagMask and a TagMask. More...
 
static TagMask operator^ (TagMask lhs, long rhs)
 Apply bitwise XOR operator to a TagMask and a long. More...
 
static long operator^ (long lhs, TagMask rhs)
 Apply bitwise XOR operator to a long and a TagMask. More...
 
static TagMask operator~ (TagMask mask)
 Apply bitwise NOT operator to a TagMask. More...
 
static int NameToTag (string name)
 Gets the index of a given tag in the Tag.Tags array. More...
 
static string TagToName (int tag)
 Gets the tag name at the given index in the Tag.Tags array. More...
 
static long GetMask (params string[] names)
 Get a mask value that contains all the given tag names. More...
 
static long GetMask (string name)
 Get a mask value that contains the given tag name. More...
 

Static Public Attributes

const long UntaggedMask = 1 << 0
 Mask value for the Untagged tag. More...
 
const long RespawnMask = 1 << 1
 Mask value for the Respawn tag. More...
 
const long FinishMask = 1 << 2
 Mask value for the Finish tag. More...
 
const long EditorOnlyMask = 1 << 3
 Mask value for the EditorOnly tag. More...
 
const long MainCameraMask = 1 << 4
 Mask value for the MainCamera tag. More...
 
const long PlayerMask = 1 << 5
 Mask value for the Player tag. More...
 
const long GameControllerMask = 1 << 6
 Mask value for the GameController tag. More...
 

Properties

long Value [get, set]
 The value of the mask as a 64-bit integer. More...
 

Detailed Description

Used to select tags in the inspector, including the ability to select multiple tags.

Works similar to LayerMask. If you have a custom GameTag script generated, your custom tags will be available here too. You can find code constants for those tags in GameTagMask. Like LayerMask, TagMask is implicitly convertable to and from an integer value (long in this case).

Constructor & Destructor Documentation

◆ TagMask()

Infohazard.Core.TagMask.TagMask ( long  value)

Initialize a new TagMask with the given value.

Parameters
valueThe value to initialize with, representing which tags are "on".

Member Function Documentation

◆ Equals() [1/2]

override bool Infohazard.Core.TagMask.Equals ( object  obj)

◆ Equals() [2/2]

bool Infohazard.Core.TagMask.Equals ( TagMask  other)

◆ GetHashCode()

override int Infohazard.Core.TagMask.GetHashCode ( )

◆ GetMask() [1/2]

static long Infohazard.Core.TagMask.GetMask ( params string[]  names)
static

Get a mask value that contains all the given tag names.

Parameters
namesNames of tags to include in the mask.
Returns
The created mask.

◆ GetMask() [2/2]

static long Infohazard.Core.TagMask.GetMask ( string  name)
static

Get a mask value that contains the given tag name.

Parameters
nameName of tag to include in the mask.
Returns
The created mask.

◆ NameToTag()

static int Infohazard.Core.TagMask.NameToTag ( string  name)
static

Gets the index of a given tag in the Tag.Tags array.

Parameters
nameTag name.
Returns
The index of the tag or -1 if it doesn't exist.

◆ operator long()

static implicit Infohazard.Core.TagMask.operator long ( TagMask  mask)
static

Convert a TagMask to a long.

Parameters
maskTagMask to convert.
Returns
The mask's value.

◆ operator TagMask()

static implicit Infohazard.Core.TagMask.operator TagMask ( long  mask)
static

Convert a long to a TagMask.

Parameters
maskThe mask value.
Returns
The created TagMask.

◆ operator&() [1/3]

static TagMask Infohazard.Core.TagMask.operator& ( in TagMask  lhs,
in TagMask  rhs 
)
static

Apply bitwise AND operator to two TagMasks.

◆ operator&() [2/3]

static long Infohazard.Core.TagMask.operator& ( long  lhs,
TagMask  rhs 
)
static

Apply bitwise AND operator to a long and a TagMask.

◆ operator&() [3/3]

static TagMask Infohazard.Core.TagMask.operator& ( TagMask  lhs,
long  rhs 
)
static

Apply bitwise AND operator to a TagMask and a long.

◆ operator^() [1/3]

static long Infohazard.Core.TagMask.operator^ ( long  lhs,
TagMask  rhs 
)
static

Apply bitwise XOR operator to a long and a TagMask.

◆ operator^() [2/3]

static TagMask Infohazard.Core.TagMask.operator^ ( TagMask  lhs,
long  rhs 
)
static

Apply bitwise XOR operator to a TagMask and a long.

◆ operator^() [3/3]

static TagMask Infohazard.Core.TagMask.operator^ ( TagMask  lhs,
TagMask  rhs 
)
static

Apply bitwise XOR operator to a TagMask and a TagMask.

◆ operator|() [1/3]

static long Infohazard.Core.TagMask.operator| ( long  lhs,
TagMask  rhs 
)
static

Apply bitwise OR operator to a long and a TagMask.

◆ operator|() [2/3]

static TagMask Infohazard.Core.TagMask.operator| ( TagMask  lhs,
long  rhs 
)
static

Apply bitwise OR operator to a TagMask and a long.

◆ operator|() [3/3]

static TagMask Infohazard.Core.TagMask.operator| ( TagMask  lhs,
TagMask  rhs 
)
static

Apply bitwise OR operator to a TagMask and a TagMask.

◆ operator~()

static TagMask Infohazard.Core.TagMask.operator~ ( TagMask  mask)
static

Apply bitwise NOT operator to a TagMask.

◆ TagToName()

static string Infohazard.Core.TagMask.TagToName ( int  tag)
static

Gets the tag name at the given index in the Tag.Tags array.

Parameters
tagTag index. Must be in range [0, TAG COUNT - 1].
Returns
The tag's name.

◆ ToString()

override string Infohazard.Core.TagMask.ToString ( )

Member Data Documentation

◆ EditorOnlyMask

const long Infohazard.Core.TagMask.EditorOnlyMask = 1 << 3
static

Mask value for the EditorOnly tag.

◆ FinishMask

const long Infohazard.Core.TagMask.FinishMask = 1 << 2
static

Mask value for the Finish tag.

◆ GameControllerMask

const long Infohazard.Core.TagMask.GameControllerMask = 1 << 6
static

Mask value for the GameController tag.

◆ MainCameraMask

const long Infohazard.Core.TagMask.MainCameraMask = 1 << 4
static

Mask value for the MainCamera tag.

◆ PlayerMask

const long Infohazard.Core.TagMask.PlayerMask = 1 << 5
static

Mask value for the Player tag.

◆ RespawnMask

const long Infohazard.Core.TagMask.RespawnMask = 1 << 1
static

Mask value for the Respawn tag.

◆ UntaggedMask

const long Infohazard.Core.TagMask.UntaggedMask = 1 << 0
static

Mask value for the Untagged tag.

Property Documentation

◆ Value

long Infohazard.Core.TagMask.Value
getset

The value of the mask as a 64-bit integer.


The documentation for this struct was generated from the following file: