Class: Fable::Choice

Inherits:
RuntimeObject show all
Defined in:
lib/fable/choice.rb

Instance Attribute Summary collapse

Attributes inherited from RuntimeObject

#original_object, #own_debug_metadata, #parent, #path

Instance Method Summary collapse

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

#indexObject

The original index into current_choices list on the Story when this choice was generated, for convenience



13
14
15
# File 'lib/fable/choice.rb', line 13

def index
  @index
end

#invisible_defaultObject Also known as: invisible_default?

Returns the value of attribute invisible_default.



15
16
17
# File 'lib/fable/choice.rb', line 15

def invisible_default
  @invisible_default
end

#original_thread_indexObject

Returns the value of attribute original_thread_index.



15
16
17
# File 'lib/fable/choice.rb', line 15

def original_thread_index
  @original_thread_index
end

#source_pathObject

Get the path to the original choice point - where was this choice defined in the story?



9
10
11
# File 'lib/fable/choice.rb', line 9

def source_path
  @source_path
end

#target_pathObject

Returns the value of attribute target_path.



15
16
17
# File 'lib/fable/choice.rb', line 15

def target_path
  @target_path
end

#textObject

The main text presented to the player for this choice



4
5
6
# File 'lib/fable/choice.rb', line 4

def text
  @text
end

#thread_at_generationObject

Returns the value of attribute thread_at_generation.



15
16
17
# File 'lib/fable/choice.rb', line 15

def thread_at_generation
  @thread_at_generation
end

Instance Method Details

#path_string_on_choiceObject

The target path that the story should be diverted to if the choice is chosen



22
23
24
# File 'lib/fable/choice.rb', line 22

def path_string_on_choice
  return self.target_path.to_s
end

#path_string_on_choice=(value) ⇒ Object



26
27
28
29
# File 'lib/fable/choice.rb', line 26

def path_string_on_choice=(value)
  self.target_path = Path.new(value)
  value
end