Class: Fable::ChoicePoint
- Inherits:
-
RuntimeObject
- Object
- RuntimeObject
- Fable::ChoicePoint
- Defined in:
- lib/fable/choice_point.rb
Instance Attribute Summary collapse
-
#has_choice_only_content ⇒ Object
(also: #has_choice_only_content?)
Returns the value of attribute has_choice_only_content.
-
#has_condition ⇒ Object
(also: #has_condition?)
Returns the value of attribute has_condition.
-
#has_start_content ⇒ Object
(also: #has_start_content?)
Returns the value of attribute has_start_content.
-
#invisible_default ⇒ Object
(also: #invisible_default?)
Returns the value of attribute invisible_default.
-
#once_only ⇒ Object
(also: #once_only?)
Returns the value of attribute once_only.
-
#path_on_choice ⇒ Object
The ChoicePoint represents the point within the Story where a Choice instance gets generated.
Attributes inherited from RuntimeObject
#original_object, #own_debug_metadata, #parent, #path
Instance Method Summary collapse
- #choice_target ⇒ Object
- #flags=(flag) ⇒ Object
- #path_string_on_choice ⇒ Object
- #path_string_on_choice=(value) ⇒ Object
- #to_s ⇒ Object
Methods inherited from RuntimeObject
#compact_path_string, #convert_path_to_relative, #copy, #debug_line_number_of_path, #debug_metadata, #indentation_string, #initialize, #resolve_path, #root_content_container
Constructor Details
This class inherits a constructor from Fable::RuntimeObject
Instance Attribute Details
#has_choice_only_content ⇒ Object Also known as: has_choice_only_content?
Returns the value of attribute has_choice_only_content.
3 4 5 |
# File 'lib/fable/choice_point.rb', line 3 def has_choice_only_content @has_choice_only_content end |
#has_condition ⇒ Object Also known as: has_condition?
Returns the value of attribute has_condition.
3 4 5 |
# File 'lib/fable/choice_point.rb', line 3 def has_condition @has_condition end |
#has_start_content ⇒ Object Also known as: has_start_content?
Returns the value of attribute has_start_content.
3 4 5 |
# File 'lib/fable/choice_point.rb', line 3 def has_start_content @has_start_content end |
#invisible_default ⇒ Object Also known as: invisible_default?
Returns the value of attribute invisible_default.
3 4 5 |
# File 'lib/fable/choice_point.rb', line 3 def invisible_default @invisible_default end |
#once_only ⇒ Object Also known as: once_only?
Returns the value of attribute once_only.
3 4 5 |
# File 'lib/fable/choice_point.rb', line 3 def once_only @once_only end |
#path_on_choice ⇒ Object
The ChoicePoint represents the point within the Story where a Choice instance gets generated. The distinction is made because the text of the choice can be dynamically generated
18 19 20 |
# File 'lib/fable/choice_point.rb', line 18 def path_on_choice @path_on_choice end |
Instance Method Details
#choice_target ⇒ Object
34 35 36 |
# File 'lib/fable/choice_point.rb', line 34 def choice_target self.resolve_path(@path_on_choice).container end |
#flags=(flag) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/fable/choice_point.rb', line 46 def flags=(flag) self.has_condition = (flag & 1) > 0 self.has_start_content = (flag & 2) > 0 self.has_choice_only_content = (flag & 4) > 0 self.invisible_default = (flag & 8) > 0 self.once_only = (flag & 16) > 0 end |
#path_string_on_choice ⇒ Object
38 39 40 |
# File 'lib/fable/choice_point.rb', line 38 def path_string_on_choice compact_path_string(path_on_choice) end |
#path_string_on_choice=(value) ⇒ Object
42 43 44 |
# File 'lib/fable/choice_point.rb', line 42 def path_string_on_choice=(value) self.path_on_choice = Path.new(value) end |
#to_s ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fable/choice_point.rb', line 54 def to_s target_line_number = debug_line_number_of_path(path_on_choice) target_string = path_on_choice.to_s if !target_line_number.nil? target_string = " line #{target_line_number} (#{target_string})" end return "Choice: -> #{target_string}" end |