mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-02 13:01:40 +08:00
Clean up stage persistence API
This commit is contained in:
@ -2,10 +2,11 @@ if (this.stages !== undefined) throw new Error('Redifining stages global!');
|
||||
this.stages = {};
|
||||
|
||||
stages.AbstractStage = class AbstractStage {
|
||||
// Initialize this stage's internal state. The glyph may already include
|
||||
// output from this stage. If the internal state can be initialized in such
|
||||
// a way to achieve that output, it should be; doing so allows users to make
|
||||
// some edits, switch to another glyph, and later resume where they left off.
|
||||
// This method should fill in this stage's field in glyph.stages. The glyph
|
||||
// may already have a value for this stage set. If so, this stage's internal
|
||||
// state should be initialized in such a way to achieve that output, if that
|
||||
// is possible; doing so allows users to make some edits, switch to another
|
||||
// glyph, and then switch back and continue where they left off.
|
||||
constructor(glyph) {
|
||||
// Session variables the interface by which the stage interacts with UI:
|
||||
// - type - String type of this stage.
|
||||
@ -27,8 +28,8 @@ stages.AbstractStage = class AbstractStage {
|
||||
this.colors = ['#0074D9', '#2ECC40', '#FFDC00', '#FF4136', '#7FDBFF',
|
||||
'#001F3F', '#39CCCC', '#3D9970', '#01FF70', '#FF851B'];
|
||||
}
|
||||
// Update the stage's internal state and the editor.glyph Session variable
|
||||
// based on the event.
|
||||
// Update the stage's internal state and possibly update this stage's field
|
||||
// in glyph.stages based on the event.
|
||||
handleEvent(glyph, event, template) {
|
||||
assert(false, 'handleEvent was not implemented!');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user