--- nono/vm/event.cpp 2026/04/29 17:04:29 1.1.1.2 +++ 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; @@ -20,13 +22,27 @@ 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->putmsg("Event Name \"%s\" is too long(%d chars)", + dev->putmsgn("Event Name \"%s\" is too long(%d chars)", name.c_str(), (int)name.length()); name.resize(25); }