BlueRoseNote/05-SDHGame/Inventory设计.md
2023-06-29 11:55:02 +08:00

29 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Inventory设计
date: 2022-08-12 14:18:31
excerpt:
tags: SDHGame
rating: ⭐
---
## 设计方案
直接使用Lyra的 **Entry - Instance - Definition - Fragment**结构以及FFastArraySerializer/FFastArraySerializerItem网络同步结构。并针对一些设计做出改动。
### 宝石/词条
- 宝石的基类现在统一改名成Attachment词条命名为Word。
- 两者数据存储在ItemInstance中。实现专门的Fragment用来设置ItemInstance的里存储数据。
### 可使用物品
考虑到需要便捷的自定义Use()逻辑,思路有二(目前倾向于第二个):
1. ~~在ItemDefinition里编写对应的几个BlueprintNativeEvent()并根据需要进行Overrider。之后ItemInstance的对应接口函数调用ItemDefinition中的函数即可实现。~~
2. 在ItemInstance里放置几个行为的Delegate。创建几个对应行为的Fragment在创建时将内部的函数函数绑到Delegate上。
## 物品列表
- CanBeUse
- Weapon
- Equip
- Material
- Token
- 灵石
- Attachable
- 生命宝石