struct

Character

Inherits YAML::Serializable < Struct < Value < Object

Represents the player's character in the game. The character is serializable and any fields annotated with YAML::Field will persist between saves.

You can extend this for additional functionality.

Example:

We could add a skill field to the character.

struct Character
  @[YAML::Field(key: "skill")]
  property skill : Int32 = 0
end

The new skill field can now be utilized in a Scene or Command.

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(name : String)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Instance methods

name
Source
name=(name : String)
Source