CodeSubWars 0.4.7b
CodeSubWars::CSWEvent Class Reference

#include <CSWEvent.h>

Inherited by CSWPyEvent.

Public Member Functions

std::shared_ptr< CSWIMessagegetMessage ()
 

Static Public Member Functions

static PtrType create (std::shared_ptr< CSWObject > pSender, std::shared_ptr< CSWObject > pReceiver, std::shared_ptr< CSWIMessage > pMessage, double fExpireTime)
 

Detailed Description

This class encapsulates an event. An event will delivered from sender to an receiver. It contains a message and a time to life.

Member Function Documentation

◆ create()

CSWEvent::PtrType CodeSubWars::CSWEvent::create ( std::shared_ptr< CSWObject pSender,
std::shared_ptr< CSWObject pReceiver,
std::shared_ptr< CSWIMessage pMessage,
double  fExpireTime 
)
static

Creates a new Event.

Parameters
pSenderThe sender (should always be self, because you never know other submarines)
pReceiverThe receiver (should always be self, because you never know other submarines)
pMessageThe message that should be delivered.
fExpireTimeThe time to life in seconds. This is clamped to range [0, 20].

◆ getMessage()

CSWIMessage::PtrType CodeSubWars::CSWEvent::getMessage ( )

Returns the containing message.

Returns
The containing message.

Generated at Sun Aug 7 2022 for project CodeSubWars. www.codesubwars.org