18#ifndef __EVENTPROCESSOR_H
19#define __EVENTPROCESSOR_H
38 STATE_ABORT_SCHEDULED,
44 : m_abortState(
AbortState::STATE_RUNNING), m_addTime(0), m_execTime(0) { }
62 bool IsRunning()
const {
return (m_abortState == AbortState::STATE_RUNNING); }
63 bool IsAbortScheduled()
const {
return (m_abortState == AbortState::STATE_ABORT_SCHEDULED); }
64 bool IsAborted()
const {
return (m_abortState == AbortState::STATE_ABORTED); }
91using is_lambda_event = std::enable_if_t<!std::is_base_of_v<BasicEvent, std::remove_pointer_t<std::remove_cvref_t<T>>>>;
100 void KillAllEvents(
bool force);
113 std::multimap<uint64, BasicEvent*>
const&
GetEvents()
const {
return m_events; }
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::enable_if_t<!std::is_base_of_v< BasicEvent, std::remove_pointer_t< std::remove_cvref_t< T > > > > is_lambda_event
Milliseconds randtime(Milliseconds min, Milliseconds max)
bool IsAbortScheduled() const
virtual void Abort(uint64)
virtual bool IsDeletable() const
virtual bool Execute(uint64, uint32)
std::multimap< uint64, BasicEvent * > m_events
std::multimap< uint64, BasicEvent * > const & GetEvents() const
is_lambda_event< T > AddEvent(T &&event, Milliseconds e_time, bool set_addtime=true)
is_lambda_event< T > AddEventAtOffset(T &&event, Milliseconds offset)
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
void AddEventAtOffset(BasicEvent *event, Milliseconds offset, Milliseconds offset2)
is_lambda_event< T > AddEventAtOffset(T &&event, Milliseconds offset, Milliseconds offset2)
Milliseconds CalculateTime(Milliseconds t_offset) const
LambdaBasicEvent(T &&callback)
bool Execute(uint64, uint32) override
void Update(VignetteData &vignette, WorldObject const *owner)