Class: Tardvig::Act Abstract
Overview
This class is abstract.
Represents the abstract part of your game. It may be anything, depends on your realization: level, location, cut-scene, credits, etc.
Class Method Summary collapse
Instance Method Summary collapse
-
#display_format ⇒ Object
This method should return the object which will be sent to the display.
-
#notify_display ⇒ Object
This method notifies your display via GameIO when the act is executed.
Methods inherited from Command
Constructor Details
This class inherits a constructor from Tardvig::Command
Class Method Details
.act_type(type) ⇒ Object .act_type ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/tardvig/act.rb', line 12 def act_type(type = nil) if type @type = type elsif @type @type elsif superclass.respond_to? :act_type superclass.act_type end end |
.subject(value) ⇒ Object .subject ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/tardvig/act.rb', line 35 def subject(value = nil) if value @subject = value else @subject end end |
Instance Method Details
#display_format ⇒ Object
This method should return the object which will be sent to the display. By default it returns the subject. But you can redefine it.
65 66 67 |
# File 'lib/tardvig/act.rb', line 65 def display_format self.class.subject end |
#notify_display ⇒ Object
This method notifies your display via GameIO when the act is executed. You can redefine it if you want to send another message or do not want to send anything.
58 59 60 |
# File 'lib/tardvig/act.rb', line 58 def notify_display io.happen :act_start, type: self.class.act_type, subject: display_format end |