diff --git a/_server/editor_file.js b/_server/editor_file.js index 84c6595f..9b9f0418 100644 --- a/_server/editor_file.js +++ b/_server/editor_file.js @@ -3,6 +3,7 @@ editor_file_wrapper = function (editor) { } + // 这个函数之后挪到editor.table? editor_file_proto.prototype.loadCommentjs=function(callback){ var commentjs = { 'comment': 'comment', diff --git a/_server/refactoring.md b/_server/refactoring.md index 7c3380c2..8ea8c365 100644 --- a/_server/refactoring.md +++ b/_server/refactoring.md @@ -1,9 +1,18 @@ # 重构 +总体思路 + 按功能拆分文件 + 左侧页面模块化, 方便添加 + 不同的模式的文件操作尽可能模块化 +目前主要在重构editor_file, 思路是editor.file负责把editor.game内的游戏数据格式化成字符串以及写入到文件, 由editor.game来修改数据 ++ editor.file维护一些标记, 描述哪些数据需要格式化并写入, 在save时写入文件(自动保存的话就是每次修改数据都触发save) ++ editor.game修改数据, 并修改editor.file中的标记 ++ 此思路下editor.file的大部分内容会挪到editor.game, editor.game和editor.table可能会再进一步合并拆分 + +editor_file之后是更改editor.map的储存方式, 现有的存对象的模式要在对象和数字间来回转换, 非常繁琐和奇怪 + +再之后是把editor_unsorted_*.js整理清晰 ## 文件结构