Click or drag to resize
ThingsAdd Method (String, String, Room)
Hartismere School

[This is preliminary documentation and is subject to change.]

Adds a new Thing to the collection of Things.

Namespace: EJW.TextBasedAdventure
Assembly: EJW.TextBasedAdventure (in EJW.TextBasedAdventure.dll) Version: 2.0.5850.21153
Syntax
public Thing Add(
	string Name,
	string Text,
	Room Room
)

Parameters

Name
Type: SystemString
Name of the Thing.
Text
Type: SystemString
Description of the Thing (Displayed when the player "Inspects" it. Can be overridden with DescriptionOverride.
Room
Type: EJW.TextBasedAdventureRoom
Starting Room for the thing. Can be null to be hidden.

Return Value

Type: Thing
The new Thing.
Exceptions
ExceptionCondition
ExceptionName must be unique.
Examples
To add a new Thing...
Game g = new Game("Demo");
g.Rooms.Add("Kitchen","A clean and tidy kitchen.");
g.Things.Add("hat","It's green and old.",g.Rooms["Kitchen"]);
See Also