blob: 028515ce1a1165597f36c4f67f215fe9dda23575 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#pragma once
#include <AK/Vector.h>
class Event;
class TimerEvent;
class Object {
public:
Object(Object* parent = nullptr);
virtual ~Object();
virtual const char* className() const { return "Object"; }
virtual void event(Event&);
Vector<Object*>& children() { return m_children; }
Object* parent() { return m_parent; }
const Object* parent() const { return m_parent; }
void startTimer(int ms);
void stopTimer();
bool hasTimer() const { return m_timerID; }
private:
virtual void onTimer(TimerEvent&);
void addChild(Object&);
void removeChild(Object&);
Object* m_parent { nullptr };
int m_timerID { 0 };
Vector<Object*> m_children;
};
|