EntityMessage¶
local EntityMessage = require("encompass").EntityMessage
An EntityMessage is a kind of message that is consumed by EntityModifiers to modify a particular entity.
An EntityMessage implicitly contains an entity
key.
Function Reference¶
-
EntityMessage.
define
(name, required_field_types, optional_field_types)¶ Arguments: - name (string) – The name of the EntityMessage prototype.
- required_field_types (table) – A table where the keys are field names and the values are types. If one of these fields is missing when the EntityMessage is instantiated, or a field is passed to the message with an incorrect type, an error is thrown.
- optional_field_types (table) – A table where the keys are field names and the values are types. If a field is passed to the message with an incorrect type, an error is thrown.
Returns: A new EntityMessage prototype.
Example:
local EntityMessage = require("encompass").EntityMessage
return EntityMessage.define('DeactivateEntityMessage')