C4 Engine
C4 Engine API Documentation


Defined in:  C4Messages.h
Called by the Message Manager to respond to a received message.

virtual bool HandleMessage(Player *sender) const override;

sender A pointer to the Player instance who sent the message.
When a message is received on any machine, the Message Manager calls the HandleMessage function for the message object before attempting any other kind of processing for the message. The HandleMessage function can be overridden in a Message subclass in order to provide code that responds to the particular message type. If the HandleMessage function returns true, then the Message Manager considers the message handled, and no further processing is performed. If the HandleMessage function returns false, then the Message Manager examines the message type and handles it accordingly. For any custom message types, the Application::ReceiveMessage function is then called for the message object.
See Also