Class: Game_CommonEvent
- Inherits:
-
Object
- Object
- Game_CommonEvent
- Defined in:
- lib/rgss3_default_scripts/Game_CommonEvent.rb
Overview
** Game_CommonEvent
This class handles common events. It includes functionality for execution of
parallel process events. It’s used within the Game_Map class ($game_map).
Instance Method Summary collapse
-
#active? ⇒ Boolean
————————————————————————– * Determine if Active State ————————————————————————–.
-
#initialize(common_event_id) ⇒ Game_CommonEvent
constructor
————————————————————————– * Object Initialization ————————————————————————–.
-
#refresh ⇒ Object
————————————————————————– * Refresh ————————————————————————–.
-
#update ⇒ Object
————————————————————————– * Frame Update ————————————————————————–.
Constructor Details
#initialize(common_event_id) ⇒ Game_CommonEvent
-
Object Initialization
12 13 14 15 |
# File 'lib/rgss3_default_scripts/Game_CommonEvent.rb', line 12 def initialize(common_event_id) @event = $data_common_events[common_event_id] refresh end |
Instance Method Details
#active? ⇒ Boolean
-
Determine if Active State
29 30 31 |
# File 'lib/rgss3_default_scripts/Game_CommonEvent.rb', line 29 def active? @event.parallel? && $game_switches[@event.switch_id] end |
#refresh ⇒ Object
-
Refresh
19 20 21 22 23 24 25 |
# File 'lib/rgss3_default_scripts/Game_CommonEvent.rb', line 19 def refresh if active? @interpreter ||= Game_Interpreter.new else @interpreter = nil end end |
#update ⇒ Object
-
Frame Update
35 36 37 38 39 40 |
# File 'lib/rgss3_default_scripts/Game_CommonEvent.rb', line 35 def update if @interpreter @interpreter.setup(@event.list) unless @interpreter.running? @interpreter.update end end |