Returns a room from a specified value, that may be dynamic. If no value is given, a new room is returned.
This function does not generate a change.
room([id])
Argument | Type | Description |
---|---|---|
id | int/str (optional) | The Id for the room to return. The Id can also be a name for a room (see set_name). |
Returns a room. A lookup_err() is returned in case a room Id is given which is not found inside the collection.
This code shows an example usage of room():
// Create a room which we can use in the example
id = (.my_room = room()).id();
[
room(id),
room(),
];
Example return value in JSON format
[
"room:18",
"room:nil"
]