From 9861319734de2e1c1c9e98ce12f4ea0071d9cbcf Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Tue, 23 Apr 2019 17:49:49 -0400 Subject: [PATCH] =?UTF-8?q?update=20refactoring.md=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E9=87=8D=E6=9E=84=E6=80=9D=E8=B7=AF,=E5=85=B3?= =?UTF-8?q?=E4=BA=8Eedtior=5Ffile=E7=9A=84=E9=87=8D=E6=9E=84=E6=80=9D?= =?UTF-8?q?=E8=80=83=E7=9A=84(=E5=8F=AF=E8=83=BD)=E6=AF=94=E8=BE=83?= =?UTF-8?q?=E6=B8=85=E6=99=B0=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/editor_file.js | 1 + _server/refactoring.md | 9 +++++++++ 2 files changed, 10 insertions(+) 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整理清晰 ## 文件结构