mirror of
https://github.com/Shu-Ying/noname-shuying.git
synced 2026-10-23 08:10:00 +08:00
fixed # 重构梦三项目结构
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export const getAvailableStoryChoices = (run, content) => {
|
||||
const flags = run.storyFlags || {};
|
||||
return (content?.choices || []).filter(choice => {
|
||||
return (choice.requires || []).every(flag => Boolean(flags[flag]))
|
||||
&& (choice.excludes || []).every(flag => !flags[flag]);
|
||||
});
|
||||
};
|
||||
|
||||
export const applyStoryOutcome = (run, outcome = {}) => {
|
||||
if (!run.storyFlags) run.storyFlags = {};
|
||||
Object.assign(run.storyFlags, outcome.flags || {});
|
||||
return outcome;
|
||||
};
|
||||
Reference in New Issue
Block a user