GOOC - Game Oriented Object C

GOOC - Game Oriented Object C

Next: Multiple-Object Event Test, Up: Event System
[Contents]

14.1. Sending Events

14.1. Sending Events

An event is sent from a sender object to a receiver object, using an object pointer stored in one of the link fields, with an event ID and a set of arguments (up to a maximum of 7). Optionally, a condition may be used to determine whether to send the event or not. The specifics of the event instructions are specified in the instructions list chapter.

There are three methods of sending events to other objects: sending an event directly, broadcasting an event to all objects, and cascading an event from a parent object. In all of these methods, the sender of the event is the object that called the event instruction.

Direct Event

Direct Event

Sends an event directly to another object. The receiver is the object specified in the instruction.

Broadcast Event

Broadcast Event

Sends an event to all living objects. This type of event also runs a test on all potential objects to make it so only certain objects can receive the event. Whether an object receives the event is determined by the event test.

Cascade Event

Cascade Event

Recursively sends an event to all children of a target object. This type of event also runs a test on all potential objects to make it so only certain objects can receive the event. Whether an object receives the event is determined by the event test.