--- nono/lib/object.cpp 2026/04/29 17:05:15 1.1.1.9 +++ nono/lib/object.cpp 2026/04/29 17:05:26 1.1.1.10 @@ -9,16 +9,17 @@ // // オブジェクトはログ出力機能 (とそのための自身のオブジェクト名) を持つ。 +#include "nono.h" #include "object.h" #include "logger.h" #include "mainapp.h" // コンストラクタ -Object::Object(int objid_) +Object::Object(uint objid_) { objid = objid_; - assertmsg(OBJ_NONE <= objid && objid < idname.size(), - "objid=%d, size=%zd", objid, idname.size()); + assertmsg(objid < idname.size(), + "objid=%u, size=%zu", objid, idname.size()); // オブジェクト名(ログ表示名)は ID から引く。 objname = idname[objid]; @@ -90,9 +91,9 @@ Object::GetIdStr() const // 指定のオブジェクト ID を文字列にして返す /*static*/ const char * -Object::GetIdStr(int target_id) +Object::GetIdStr(uint target_id) { - if (OBJ_NONE < target_id && target_id < idname.size()) { + if (target_id < idname.size()) { return idname[target_id]; } return "unknownID?"; @@ -100,7 +101,7 @@ Object::GetIdStr(int target_id) // 指定のオブジェクト ID を持つオブジェクトを返す。 /*static*/ Object * -Object::GetObject(int target_id) +Object::GetObject(uint target_id) { return gMainApp.GetObject(target_id); }