Click or drag to resize
Bucket Class
Hartismere School

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

A dictionary object to store any value.
Inheritance Hierarchy
SystemObject
  EJW.TextBasedAdventureBucket

Namespace: EJW.TextBasedAdventure
Assembly: EJW.TextBasedAdventure (in EJW.TextBasedAdventure.dll) Version: 2.0.5850.21153
Syntax
[SerializableAttribute]
public class Bucket : IEnumerable<Object>, 
	IEnumerable

The Bucket type exposes the following members.

Properties
  NameDescription
Public propertyCount
Gets the number of items stored in the Bucket.
Public propertyItem
Gets or Sets the Bucket item at the specified key.
Public propertyKeys
A list of all the Keys in this Bucket.
Public propertyValues
A list of all the Values in this Bucket.
Top
Methods
  NameDescription
Public methodAdd
Adds the specified item to the Bucket.
Public methodContainsKey
Determines whether the Bucket contains the specified key.
Public methodGet
Retrieves the specified item from the Bucket.
Public methodRemove
Removes the value with the specified key from the Bucket.
Top
Remarks
Use the Bucket to store additional data.

Data held in a Bucket is stored when the player saves their progress.

Examples
To store a value representing the player's health:
Game.Bucket["player_health"] = 100;
...
Game.Bucket["player_health"] -= 1;
...
if (Game.Bucket["player_health"] <= 0) {
...
}
See Also