Commit Graph

4 Commits

Author SHA1 Message Date
83fb06a229 feat(utils): 重构 OrderedMap 为 OrderMap,支持排序和非阻塞遍历
- 将原有的 `OrderedMap` 替换为 `OrderMap`,基于 `map` 和 `slice` 实现,提升性能并简化逻辑
- 支持自定义 key 排序规则,若未提供则按插入顺序维护
- 提供 `Set`、`Get`、`Delete`、`Keys`、`Values` 等基本操作,均并发安全
- 引入非阻塞遍历机制(`Iter`、`Iter
2025-10-22 21:30:05 +08:00
ae88790ed3 修改range,支持技能效果
Updated comments for clarity and consistency in the OrderedMap implementation, enhancing the understanding of the data structure and its methods.
2025-10-22 00:57:25 +08:00
805fe8ec8d fix(fight): 修复技能效果获取逻辑并调整伤害计算方式
-
2025-09-24 19:46:42 +08:00
9b078d7820 fix(fight): 修复技能效果添加逻辑并优化效果管理
- 修改 `AddEffect` 方法,使用 `EffectID` 包装技能效果,并避免重复添加
- 将 `Effects` 类型从 `[]Effect` 改为 `*utils.OrderedMap[int, Effect]` 以提升查找和管理效率
- 移除 `Effect` 接口中的 `ID()` 方法,改由 `EffectID` 结构体维护
- 增加 `GetSkillEffect` 和 `GetDamageEffect` 方法返回带 ID 的效果结构
- 更新 `CancelTurn` 和 `Exec` 方法以适配新的数据结构
- 初始化 `Effects` 为 `OrderedMap` 实例,确保容器正确创建
2025-09-24 19:22:46 +08:00