Class: Game_Variables
- Defined in:
- scripts/00600 Script_RMXP/00100 Event_Living_Data.rb
Overview
Class that describe game variables
Instance Method Summary collapse
-
#[](index)
Getter.
-
#[]=(index, value)
Setter.
-
#initialize ⇒ Game_Variables
constructor
default initialization of game variables.
Constructor Details
#initialize ⇒ Game_Variables
default initialization of game variables
53 54 55 56 57 58 59 |
# File 'scripts/00600 Script_RMXP/00100 Event_Living_Data.rb', line 53 def initialize if $data_system super($data_system.variables.size, 0) else super(200, 0) end end |
Instance Method Details
#[](index)
Note:
return 0 if the variable is outside of the array.
Getter
64 65 66 67 68 |
# File 'scripts/00600 Script_RMXP/00100 Event_Living_Data.rb', line 64 def [](index) return 0 if size <= index super(index) end |
#[]=(index, value)
Setter
73 74 75 76 77 78 79 80 |
# File 'scripts/00600 Script_RMXP/00100 Event_Living_Data.rb', line 73 def []=(index, value) unless value.is_a?(Integer) raise TypeError, "Unexpected #{value.class} value. $game_variables store numbers and nothing else, use $option to store anything else." end super(size, 0) while size < index super(index, value) end |