I would like to store JSON values as properties of characters, as well as be able to procedurally create dialogues from bits and pieces.
I propose that the method Dialogue.start_dialogue(json_path)
receives a sibling method Dialogue.start_from_data(data, character)
, where data
is pre-parsed json (or, in my case, generated).
A possibly better API would be:
Dialogue.set_data(data)
Dialogue.set_data_from_file(json_path)
Dialogue.start()
Then the external Dialogue.start_dialogue
API could stay as it is, but use the underlying set_data_from_file
.
An additional though: if the two set_data*
methods return self
, then one can do:
Dialogue.set_data(data, character, context).start()
# or
Dialogue.set_data_from_file(json_path, character, context).start()