Monopoly — Portage moderne
0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
SequenceLifecycleMessage.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
SequenceRuntime.hpp
"
4
#include "
UIMessages.hpp
"
5
6
#include <optional>
7
8
namespace
monopoly::sequence
9
{
10
// L_Seqncr.cpp publishes the common 60 Hz TopLevelClock in numberE,
11
// regardless of a node's local clock, cadence, or number of render frames.
12
[[
nodiscard
]]
inline
std::optional<uimsg::Message>
lifecycleMessage
(
13
const
SequenceEvent
& event, std::int32_t
topLevelClock
)
14
{
15
if
(event.
label
== 0)
return
std::nullopt;
16
uimsg::Message
message{};
17
switch
(event.
kind
)
18
{
19
case
SequenceEventKind::Created
:
20
message.
type
=
uimsg::Type::SequenceStarted
;
21
message.numberD =
event
.sequenceType;
22
break
;
23
case
SequenceEventKind::ReachedEnd
:
24
message.type =
uimsg::Type::SequenceReachedEnd
;
25
message.numberD =
event
.endingAction;
26
break
;
27
case
SequenceEventKind::Destroyed
:
28
message.type =
uimsg::Type::SequenceDeleted
;
29
message.numberD =
event
.sequenceType;
30
break
;
31
default
:
32
return
std::nullopt;
33
}
34
message.numberA =
static_cast<
std::int64_t
>
(
event
.dataId);
35
message.numberB =
event
.priority;
36
message.numberC =
event
.label;
37
message.numberE =
topLevelClock
;
38
return
message;
39
}
40
}
index
unsigned index
Definition
ModernIBarSkin.cpp:25
SequenceRuntime.hpp
UIMessages.hpp
monopoly::sequence
Definition
SequenceBitmapRenderData.cpp:5
monopoly::sequence::SequenceEventKind::Created
@ Created
monopoly::sequence::SequenceEventKind::Destroyed
@ Destroyed
monopoly::sequence::SequenceEventKind::ReachedEnd
@ ReachedEnd
monopoly::sequence::lifecycleMessage
std::optional< uimsg::Message > lifecycleMessage(const SequenceEvent &event, std::int32_t topLevelClock)
Definition
SequenceLifecycleMessage.hpp:12
monopoly::uimsg::Type::SequenceStarted
@ SequenceStarted
monopoly::uimsg::Type::SequenceReachedEnd
@ SequenceReachedEnd
monopoly::uimsg::Type::SequenceDeleted
@ SequenceDeleted
monopoly::sequence::SequenceEvent
Definition
SequenceRuntime.hpp:94
monopoly::sequence::SequenceEvent::kind
SequenceEventKind kind
Definition
SequenceRuntime.hpp:95
monopoly::sequence::SequenceEvent::label
std::uint8_t label
Definition
SequenceRuntime.hpp:101
monopoly::uimsg::Message
Definition
UIMessages.hpp:40
monopoly::uimsg::Message::type
Type type
Definition
UIMessages.hpp:41
SequenceLifecycleMessage.hpp
Generated by
1.9.8