ThingsAdd Method (String, String, String) |  |
Hartismere School[This is preliminary documentation and is subject to change.]
Adds a new Thing to the collection of Things.
Namespace: EJW.TextBasedAdventureAssembly: EJW.TextBasedAdventure (in EJW.TextBasedAdventure.dll) Version: 2.0.5850.21153
Syntaxpublic Thing Add(
string Name,
string Text,
string RoomName
)
Public Function Add (
Name As String,
Text As String,
RoomName As String
) As Thing
public:
Thing^ Add(
String^ Name,
String^ Text,
String^ RoomName
)
member Add :
Name : string *
Text : string *
RoomName : string -> Thing
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. - RoomName
- Type: SystemString
Name of the starting Room for the thing.
Return Value
Type:
ThingThe new Thing.
ExceptionsException | Condition |
---|
Exception | Name must be unique. |
Exception | Room does not exist. |
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.","Kitchen");
See Also