|
|
1.1 root 1: //
2: // nono
1.1.1.4 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
7: #include "event.h"
1.1.1.3 root 8: #include "scheduler.h"
1.1 root 9:
10: // 全イベントの配列
11: std::vector<Event *> gEvents;
12:
13: // コンストラクタ
14: Event::Event()
15: {
16: // 自身をリストに追加する
17: gEvents.push_back(this);
18: }
19:
20: // デストラクタ
21: Event::~Event()
22: {
23: }
1.1.1.2 root 24:
1.1.1.3 root 25: // イベントタイマーを開始する
26: void
27: Event::Start()
28: {
29: gScheduler->StartEvent(this);
30: }
31:
32: // イベントタイマーを停止する
33: void
34: Event::Stop()
35: {
36: gScheduler->StopEvent(this);
37: }
38:
1.1.1.2 root 39: // 名前をセットする
40: void
41: Event::SetName(const std::string& val)
42: {
43: name = val;
44: if (name.length() > 25) {
1.1.1.5 ! root 45: dev->putmsgn("Event Name \"%s\" is too long(%d chars)",
1.1.1.2 root 46: name.c_str(), (int)name.length());
47: name.resize(25);
48: }
49: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.