PixelCrushers.MessageArgs Struct Reference

This struct is passed to listeners of the MessageSystem when a message is sent. More...

Public Member Functions

 MessageArgs (object sender, object target, string message, string parameter, object[] values=null)
 
 MessageArgs (object sender, string message, string parameter, object[] values=null)
 
bool Matches (string message, string parameter)
 
bool Matches (StringField message, StringField parameter)
 
bool Matches (StringField message, string parameter)
 
bool Matches (string message, StringField parameter)
 
bool IsRequiredSender (string requiredSender)
 Returns true if the args' sender matches a required sender.
 
bool IsRequiredTarget (string requiredTarget)
 Returns true if the args' target matches a required target.
 
string GetSenderString ()
 Returns the string name of the sender.
 
string GetTargetString ()
 Returns the string name of the target.
 

Public Attributes

object sender
 Reference to the message sender (e.g., GameObject or possibly custom-defined string ID).
 
object target
 Reference to the message target (e.g., GameObject or possibly custom-defined string ID).
 
string message
 
string parameter
 
object[] values
 

Properties

bool hasTarget [get]
 If true, the message arguments specify a target.
 
bool isTargetString [get]
 True if the target value is a string or StringField.
 
string targetString [get]
 If the target is a string or StringField, its value.
 
object firstValue [get]
 
int intValue [get]
 

Detailed Description

This struct is passed to listeners of the MessageSystem when a message is sent.

Constructor & Destructor Documentation

◆ MessageArgs() [1/2]

PixelCrushers.MessageArgs.MessageArgs ( object  sender,
object  target,
string  message,
string  parameter,
object[]  values = null 
)
inline

◆ MessageArgs() [2/2]

PixelCrushers.MessageArgs.MessageArgs ( object  sender,
string  message,
string  parameter,
object[]  values = null 
)
inline

Member Function Documentation

◆ GetSenderString()

string PixelCrushers.MessageArgs.GetSenderString ( )
inline

Returns the string name of the sender.

◆ GetTargetString()

string PixelCrushers.MessageArgs.GetTargetString ( )
inline

Returns the string name of the target.

◆ IsRequiredSender()

bool PixelCrushers.MessageArgs.IsRequiredSender ( string  requiredSender)
inline

Returns true if the args' sender matches a required sender.

◆ IsRequiredTarget()

bool PixelCrushers.MessageArgs.IsRequiredTarget ( string  requiredTarget)
inline

Returns true if the args' target matches a required target.

◆ Matches() [1/4]

bool PixelCrushers.MessageArgs.Matches ( string  message,
string  parameter 
)
inline

◆ Matches() [2/4]

bool PixelCrushers.MessageArgs.Matches ( string  message,
StringField  parameter 
)
inline

◆ Matches() [3/4]

bool PixelCrushers.MessageArgs.Matches ( StringField  message,
string  parameter 
)
inline

◆ Matches() [4/4]

bool PixelCrushers.MessageArgs.Matches ( StringField  message,
StringField  parameter 
)
inline

Member Data Documentation

◆ message

string PixelCrushers.MessageArgs.message

◆ parameter

string PixelCrushers.MessageArgs.parameter

◆ sender

object PixelCrushers.MessageArgs.sender

Reference to the message sender (e.g., GameObject or possibly custom-defined string ID).

◆ target

object PixelCrushers.MessageArgs.target

Reference to the message target (e.g., GameObject or possibly custom-defined string ID).

Typically null or blank string is interpreted as broadcast to all targets.

◆ values

object [] PixelCrushers.MessageArgs.values

Property Documentation

◆ firstValue

object PixelCrushers.MessageArgs.firstValue
get

◆ hasTarget

bool PixelCrushers.MessageArgs.hasTarget
get

If true, the message arguments specify a target.

◆ intValue

int PixelCrushers.MessageArgs.intValue
get

◆ isTargetString

bool PixelCrushers.MessageArgs.isTargetString
get

True if the target value is a string or StringField.

◆ targetString

string PixelCrushers.MessageArgs.targetString
get

If the target is a string or StringField, its value.


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