mkxp/scripts/Game_SelfSwitches.rb

31 lines
1.2 KiB
Ruby
Raw Normal View History

2015-11-17 20:35:51 +00:00
#==============================================================================
# ** Game_SelfSwitches
#------------------------------------------------------------------------------
# This class handles self switches. It's a wrapper for the built-in class
# "Hash." Refer to "$game_self_switches" for the instance of this class.
#==============================================================================
class Game_SelfSwitches
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@data = {}
end
#--------------------------------------------------------------------------
# * Get Self Switch
# key : key
#--------------------------------------------------------------------------
def [](key)
return @data[key] == true ? true : false
end
#--------------------------------------------------------------------------
# * Set Self Switch
# key : key
# value : ON (true) / OFF (false)
#--------------------------------------------------------------------------
def []=(key, value)
@data[key] = value
end
end