Class: Game_SelfSwitches
- Inherits:
-
Object
- Object
- Game_SelfSwitches
- Defined in:
- lib/rgss3_default_scripts/Game_SelfSwitches.rb
Overview
** Game_SelfSwitches
This class handles self switches. It's a wrapper for the built-in class
“Hash.” The instance of this class is referenced by $game_self_switches.
Instance Method Summary collapse
-
#[](key) ⇒ Object
————————————————————————– * Get Self Switch ————————————————————————–.
-
#[]=(key, value) ⇒ Object
————————————————————————– * Set Self Switch value : ON (true) / OFF (false) ————————————————————————–.
-
#initialize ⇒ Game_SelfSwitches
constructor
————————————————————————– * Object Initialization ————————————————————————–.
-
#on_change ⇒ Object
————————————————————————– * Processing When Setting Self Switches ————————————————————————–.
Constructor Details
#initialize ⇒ Game_SelfSwitches
-
Object Initialization
12 13 14 |
# File 'lib/rgss3_default_scripts/Game_SelfSwitches.rb', line 12 def initialize @data = {} end |
Instance Method Details
#[](key) ⇒ Object
-
Get Self Switch
18 19 20 |
# File 'lib/rgss3_default_scripts/Game_SelfSwitches.rb', line 18 def [](key) @data[key] == true end |
#[]=(key, value) ⇒ Object
-
Set Self Switch
value : ON (true) / OFF (false)
25 26 27 28 |
# File 'lib/rgss3_default_scripts/Game_SelfSwitches.rb', line 25 def []=(key, value) @data[key] = value on_change end |
#on_change ⇒ Object
-
Processing When Setting Self Switches
32 33 34 |
# File 'lib/rgss3_default_scripts/Game_SelfSwitches.rb', line 32 def on_change $game_map.need_refresh = true end |