Module: Lich::Common::GameSettings
- Defined in:
- documented/common/settings/gamesettings.rb
Class Method Summary collapse
-
.[](name) ⇒ OpenStruct
Retrieves a scoped setting by name from the active game settings.
-
.[]=(name, value) ⇒ void
Sets a scoped setting by name in the active game settings.
-
.active_scope ⇒ OpenStruct
Returns the currently active game settings scope.
-
.to_hash ⇒ OpenStruct
Converts the current game settings into a hash-like structure.
Class Method Details
.[](name) ⇒ OpenStruct
Retrieves a scoped setting by name from the active game settings.
15 16 17 |
# File 'documented/common/settings/gamesettings.rb', line 15 def self.[](name) Settings.get_scoped_setting(active_scope, name) end |
.[]=(name, value) ⇒ void
This method returns an undefined value.
Sets a scoped setting by name in the active game settings.
23 24 25 |
# File 'documented/common/settings/gamesettings.rb', line 23 def self.[]=(name, value) Settings.set_script_settings(active_scope, name, value) end |
.active_scope ⇒ OpenStruct
Returns the currently active game settings scope.
8 9 10 |
# File 'documented/common/settings/gamesettings.rb', line 8 def self.active_scope XMLData.game end |
.to_hash ⇒ OpenStruct
Converts the current game settings into a hash-like structure.
30 31 32 33 34 35 |
# File 'documented/common/settings/gamesettings.rb', line 30 def self.to_hash # NB: This method does not behave like a standard Ruby hash request. # It returns a root proxy for the game settings scope, allowing persistent # modifications on the returned object for legacy support. Settings.wrap_value_if_container(Settings.current_script_settings(active_scope), active_scope, []) end |