struct State
- State
- Struct
- Value
- Object
Overview
Represents the current state of a game. You can inject more fields into this to extend functionality.
Example:
Add a timestamp to the state.
Properties prefixed with a YAML::Field
annotation will automatically persist between saves.
struct State
@[YAML::Field(key: "timestamp")]
property timestamp : Time?
end
By itself, state properties don't do anything.
You can read and change state in a Scene
or Command
.
Included Modules
- YAML::Serializable
Defined in:
engine/state.crConstructors
Instance Method Summary
- #character : Character
- #character=(character : Character)
- #scene : String | Nil
- #scene=(scene : String | Nil)