Class: Game_SelfSwitches

Inherits:
Object
  • Object
show all
Defined in:
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)

Constructor Details

- (Game_SelfSwitches) initialize


  • Object Initialization




12
13
14
# File 'Game_SelfSwitches.rb', line 12

def initialize
  @data = {}
end

Instance Method Details

- (Object) [](key)


  • Get Self Switch




18
19
20
# File 'Game_SelfSwitches.rb', line 18

def [](key)
  @data[key] == true
end

- (Object) []=(key, value)


  • Set Self Switch

    value : ON (true) / OFF (false)



25
26
27
28
# File 'Game_SelfSwitches.rb', line 25

def []=(key, value)
  @data[key] = value
  on_change
end

- (Object) on_change


  • Processing When Setting Self Switches




32
33
34
# File 'Game_SelfSwitches.rb', line 32

def on_change
  $game_map.need_refresh = true
end