Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_systems
InputSystem
InputEvent.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "../TimeSystem/Watch.hpp"
4
#include "../DVarSystem/DVar.hpp"
5
#include <
ivorium_core/ivorium_core.hpp
>
6
7
namespace
iv
8
{
9
13
class
InputEvent
:
private
PrivField_Owner
< Activator >,
private
PrivField_Owner
< SumAgg< int > >,
protected
PrivValAttr_Owner
14
{
15
public
:
16
//----------------------------- instance control -------------------
17
ClientMarker
cm
;
18
19
InputEvent
(
Instance
* inst );
20
~InputEvent
();
21
22
Instance
*
instance
()
const
;
23
void
status
(
iv::TableDebugView
* view );
24
25
//--------------------------------- observers ------------------
28
PrivValAttr< bool >
attr_eventEnabled
;
29
34
PrivValAttr< Activator >
attr_activation
;
35
39
PrivValAttr< bool >
attr_hot
;
40
44
PrivField< Activator >
field_press
;
45
PrivField< Activator >
field_release
;
46
PrivField< SumAgg< int >
>
field_duration
;
47
48
//--------------------------------- called by implementors -------------------------------------------
49
protected
:
50
void
ie_start_duration
();
51
void
ie_stop_duration
();
52
53
void
ie_trigger
();
54
55
void
ie_start_activation
();
56
void
ie_stop_activation
(
bool
real );
57
58
private
:
59
virtual
void
Field_OnChanged(
Field< Activator >
* field,
bool
real )
override
;
60
virtual
void
Field_OnChanged(
Field
<
SumAgg< int >
> * field,
bool
real )
override
;
61
62
void
refresh_enabled();
63
64
void
check_consistency();
65
66
private
:
67
Instance
* inst;
68
69
bool
release_hot;
70
bool
duration;
71
72
Activator
press_reference;
73
Activator
release_reference;
74
};
75
76
}