--- nono/vm/event.cpp 2026/04/29 17:04:28 1.1.1.1 +++ nono/vm/event.cpp 2026/04/29 17:04:50 1.1.1.5 @@ -1,9 +1,11 @@ // // nono -// Copyright (C) 2018 isaki@NetBSD.org +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #include "event.h" +#include "scheduler.h" // 全イベントの配列 std::vector gEvents; @@ -19,3 +21,29 @@ Event::Event() Event::~Event() { } + +// イベントタイマーを開始する +void +Event::Start() +{ + gScheduler->StartEvent(this); +} + +// イベントタイマーを停止する +void +Event::Stop() +{ + gScheduler->StopEvent(this); +} + +// 名前をセットする +void +Event::SetName(const std::string& val) +{ + name = val; + if (name.length() > 25) { + dev->putmsgn("Event Name \"%s\" is too long(%d chars)", + name.c_str(), (int)name.length()); + name.resize(25); + } +}