Module: Lich::Common::GameSettings Private

Defined in:
documented/common/settings/gamesettings.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Class Method Summary collapse

Class Method Details

.[](name) ⇒ OpenStruct

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Retrieves a scoped setting by name from the active game settings.

Parameters:

  • name (String) —

    the name of the setting to retrieve

Returns:

  • (OpenStruct) —

    the value of the setting



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 is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Sets a scoped setting by name in the active game settings.

Parameters:

  • name (String) —

    the name of the setting to set

  • value (OpenStruct) —

    the value to assign to the setting



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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the currently active game settings scope.

Returns:

  • (OpenStruct) —

    the active game settings scope.



8
9
10
# File 'documented/common/settings/gamesettings.rb', line 8

def self.active_scope
  XMLData.game
end

.auto ⇒ OpenStruct

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

Retrieves the auto setting (deprecated).

Returns:

  • (OpenStruct) —

    the current value of the auto setting



84
85
86
87
# File 'documented/common/settings/gamesettings.rb', line 84

def self.auto
  Lich.deprecated("GameSettings.auto", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.auto=(_val) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

This method returns an undefined value.

Sets the auto setting (deprecated).

Parameters:

  • _val (OpenStruct) —

    the value to set for auto



77
78
79
# File 'documented/common/settings/gamesettings.rb', line 77

def self.auto=(_val)
  Lich.deprecated("GameSettings.auto=(val)", "not using, not applicable,", caller[0], fe_log: true)
end

.autoload ⇒ OpenStruct

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

Retrieves the autoload setting (deprecated).

Returns:

  • (OpenStruct) —

    the current value of the autoload setting



92
93
94
95
# File 'documented/common/settings/gamesettings.rb', line 92

def self.autoload
  Lich.deprecated("GameSettings.autoload", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.clear ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

This method returns an undefined value.

Clears game settings (deprecated).



68
69
70
71
# File 'documented/common/settings/gamesettings.rb', line 68

def self.clear
  Lich.deprecated("GameSettings.clear", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.load ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

This method returns an undefined value.

Loads game settings (deprecated).



41
42
43
44
# File 'documented/common/settings/gamesettings.rb', line 41

def self.load
  Lich.deprecated("GameSettings.load", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.save ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

This method returns an undefined value.

Saves game settings (deprecated).



50
51
52
53
# File 'documented/common/settings/gamesettings.rb', line 50

def self.save
  Lich.deprecated("GameSettings.save", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.save_all ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.

This method is no longer applicable.

This method returns an undefined value.

Saves all game settings (deprecated).



59
60
61
62
# File 'documented/common/settings/gamesettings.rb', line 59

def self.save_all
  Lich.deprecated("GameSettings.save_all", "not using, not applicable,", caller[0], fe_log: true)
  nil
end

.to_hash ⇒ OpenStruct

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Converts the current game settings into a hash-like structure.

Returns:

  • (OpenStruct) —

    a hash-like representation of the game settings



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