增加代码

This commit is contained in:
ival 2021-04-02 18:14:30 +08:00
parent 0c87981d43
commit bf1818da69
2 changed files with 19 additions and 7 deletions

View File

@ -4,13 +4,22 @@ export default class StateHandle {
this.$map = map;
}
update(shapeFactory, state) {
return [];
parse(shapeFactory, state) {
return state;
}
updateState(shapeFactory, state) {
update(shapeFactory, states=[]) {
return [
...this.updateState(states.map(state => this.parse(shapeFactory, state))),
...this.updateState(states.map(state => this.parse(shapeFactory, state)))
];
}
updateDepState(shapeFactory, state) {
updateState(states=[]) {
return []
}
updateDepState(states=[]) {
return []
}
}

View File

@ -121,8 +121,8 @@ export default {
},
],
stateList: [
{ status: 's1', shapeList: [[{name: 'a', status: 'st1'}, {name: 'b', status: 'st1'}], [{name: 'a', status: 'st2'}, {name: 'b', status: 'st2'}]], weight: 2, needDefault: false, loop: true },
{ status: 's2', shapeList: [[{name: 'a', status: 'st2'}, {name: 'b', status: 'st1'}], [{name: 'a', status: 'st1'}, {name: 'b', status: 'st2'}]], weight: 2, needDefault: false, lopp: false }
{ status: 's1', frameList: [[{name: 'a', status: 'st1'}, {name: 'b', status: 'st1'}], [{name: 'a', status: 'st2'}, {name: 'b', status: 'st2'}]], weight: 2, needDefault: false, loop: true },
{ status: 's2', frameList: [[{name: 'a', status: 'st2'}, {name: 'b', status: 'st1'}], [{name: 'a', status: 'st1'}, {name: 'b', status: 'st2'}]], weight: 2, needDefault: false, lopp: false }
]
}
], {
@ -299,7 +299,10 @@ export default {
reflect: true
});
this.$iscs.update();
this.$iscs.update([
{ status: 's1', frameList: [[{name: 'a', status: 'st1'}, {name: 'b', status: 'st1'}], [{name: 'a', status: 'st2'}, {name: 'b', status: 'st2'}]], weight: 2, needDefault: false, loop: true },
{ status: 's2', frameList: [[{name: 'a', status: 'st2'}, {name: 'b', status: 'st1'}], [{name: 'a', status: 'st1'}, {name: 'b', status: 'st2'}]], weight: 2, needDefault: false, lopp: false }
]);
this.$iscs.on('contextmenu', this.onContextMenu, this);
this.$iscs.on('selected', this.onSelected, this);
this.$iscs.on('keyboard', this.onKeyboard, this);