GOOC - Game Oriented Object C

GOOC - Game Oriented Object C

Next: State Change Flags, Previous: The trans Block, Up: States
[Contents]

10.4. The event Block

10.4. The event Block

The event block is one that runs whenever an event is sent to the object. The event block is the first event handler, it can accept or reject the event, or leave it unhandled for the other event handlers.

An event block MUST define two parameters: the first parameter is the ID of the received event, while the second parameter is a pointer to the event arguments. If two parameters aren't defined, a compiler warning will be thrown.

An event block is defined like this: event pre-modifiers (parameter-list) { subroutine-body } Note that pre-subroutine modifiers are the only type of modifiers that can be used.

The event block has a series of instructions specifically to be used in it, for accepting or rejecting events with various side effects.