intficpy.sequence module

TODO: * An “Up” ControlItem (pop) * “Label” ControlItem? - create a more human friendly interface for jumps/procedural navigation * Conditional logic & flow control - Idea: controller/navigator node where author defines a function (array of functions evaluated in sequence?) to determine where to read next

```

# example function to pass to a Navigator def has_done_thing(sequence):

if sequence.this_was_done:

return [2, 1]

return [2, 3]

` Use in a Sequence template: `

[

Sequence.Navigator(has_done_thing), …, # or with a labmbda Sequence.Navigator(lambda seq: [2, 1] if seq.this_was_done else [2, 3]),

]

```

class intficpy.sequence.Sequence(game, template, data=None, sticky=False)

Bases: intficpy.ifp_object.IFPObject

class ControlItem

Bases: object

read()
class Jump(destination)

Bases: intficpy.sequence.Sequence.ControlItem

Unconditionally jump to a label or index

read(game, event)
class Label(name)

Bases: intficpy.sequence.Sequence.ControlItem

read(game, event)
class Navigator(nav_func)

Bases: intficpy.sequence.Sequence.ControlItem

read(game, event)
class Pause

Bases: intficpy.sequence.Sequence.ControlItem

read(game, event)
class Prompt(save_key, label, question)

Bases: intficpy.sequence.Sequence.ControlItem

accept_input(tokens)
read(game, event='turn')
submit()
try_again()
class SaveData(save_key, value)

Bases: intficpy.sequence.Sequence.ControlItem

read(*args, **kwargs)
accept_input(tokens)

Pass current input tokens from the parser, to the method corresponding to the type of input we are currently expecting

choose(tokens)

Try to use input tokens from the parser to choose an option in the current menu

jump_to(value)

Read the sequence from the specified point. Accepts a string that is registered as a label on the Sequence or an array specifying an index on the Sequence template

next(event)
on_complete()
play(event='turn')
start()
property current_item
property current_node