LeviLamina icon indicating copy to clipboard operation
LeviLamina copied to clipboard

LL与LLSE模块化重构

Open yqs112358 opened this issue 1 year ago • 2 comments

目前设计接口拓展困难,加载器各部件耦合度过高,不利于项目的社区参与,不利于项目维护和功能拓展

改进思路(作参考)

对LL和LLSE架构进行修改:

  • 核心部分仅保留基本api支持(如hook, utils, logger)等,作为骨架支撑
  • 提供API注册接口、event注册接口等,loader mcapi eventapi llapi等各部分作为模块注册进LL/LLSE骨架
  • 编译结果仍然不变(单个dll),只是在项目内部进行架构重构,骨架的每个子组件在源码目录中都可以新开一个目录,类似BuiltinModules的架构思想

(另:LLSE源码待改进:宏简化类注册)

yqs112358 avatar Sep 13 '22 04:09 yqs112358

mc.newItem建议做成new mc.Item 事件改成类似mc.Player.events.join.subscribe((arg: mc.Events.PlayerJoinEvent) => void)(类型事件)和pl.events.died.subscribe((arg: mc.Events.PlayerDeathEvent) => void)(实例事件) 这种更OOP的样子🤔

Yuisyuu avatar Sep 15 '22 09:09 Yuisyuu

@StarsDream00 等3.x

futrime avatar Sep 15 '22 10:09 futrime