SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
event_t Struct Referenceabstract
Inheritance diagram for event_t:
noncopyable dot_t::dot_end_event_t dot_t::dot_tick_event_t expiration_callback_event_t fn_event_repeating_t< T > fn_event_t< T > monk::actions::attacks::whirling_dragon_punch_t::whirling_dragon_punch_tick_event_t monk::actions::spells::fallen_order_t::fallen_order_event_t monk::pets::storm_earth_and_fire_pet_t::sef_whirling_dragon_punch_t::sef_whirling_dragon_punch_tick_event_t paladin::echoed_spell_event_t player_event_t proc_event_t shuffle_event_t travel_event_t

Public Member Functions

 event_t (sim_t &s, actor_t *a=nullptr)
 
 event_t (actor_t &a)
 
 event_t (sim_t &s, timespan_t delta_time)
 
 event_t (actor_t &a, timespan_t delta_time)
 
timespan_t occurs () const
 
timespan_t remains () const
 
void schedule (timespan_t delta_time)
 Schedule event on the event manager.
 
void reschedule (timespan_t delta_time)
 
sim_tsim ()
 
const sim_tsim () const
 
rng::rng_trng ()
 
virtual void execute ()=0
 
virtual const char * name () const
 

Static Public Member Functions

template<class T >
static void cancel (T &e)
 
static void cancel (event_t *&e)
 

Public Attributes

sim_t_sim
 
event_tnext
 
timespan_t time
 
timespan_t reschedule_time
 
unsigned id
 
bool canceled
 
bool recycled
 
bool scheduled
 

Static Protected Member Functions

static void * operator new (std::size_t size, sim_t &sim)
 Placement-new operator for creating events. Do not use in user-code.
 
static void operator delete (void *, sim_t &)
 
static void operator delete (void *)
 
static void * operator new (std::size_t)=delete
 

Friends

void sc_format_to (const event_t &, fmt::format_context::iterator)
 
template<typename Event , typename... Args>
Event * make_event (sim_t &sim, Args &&... args)
 Creates a event. More...
 

Friends And Related Function Documentation

◆ make_event

template<typename Event , typename... Args>
Event* make_event ( sim_t sim,
Args &&...  args 
)
friend

Creates a event.

This function should be used as the one and only way to create new events. It is used to hide internal placement-new mechanism for efficient event allocation, and also makes sure that any event created is properly added to the event manager (scheduled).