Package cn.nukkit.entity.ai.memory
Interface IMemoryStorage
- All Known Implementing Classes:
MemoryStorage
记忆存储器
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(MemoryType<?> type) 清空指定记忆类型数据为nulldefault <D> boolean
compareDataTo
(MemoryType<D> type, Object to) 使用指定的数据对比记忆类型存储的数据<D> D
get
(MemoryType<D> type) 从指定记忆类型获取数据Map<MemoryType<?>,
?> getAll()
获取所有记忆default boolean
isEmpty
(MemoryType<?> type) 检查指定记忆类型数据是否为空(null)default boolean
notEmpty
(MemoryType<?> type) 检查指定记忆类型数据是否不为空(null)<D> void
put
(MemoryType<D> type, D data) 写入数据到记忆类型
-
Method Details
-
put
写入数据到记忆类型- Type Parameters:
D
- 数据类型- Parameters:
type
- 记忆类型data
- 数据
-
get
从指定记忆类型获取数据- Type Parameters:
D
- 数据类型- Parameters:
type
- 记忆类型- Returns:
- 数据
-
getAll
Map<MemoryType<?>,?> getAll()获取所有记忆- Returns:
- 所有记忆
-
clear
清空指定记忆类型数据为null- Parameters:
type
- 记忆类型
-
isEmpty
检查指定记忆类型数据是否为空(null)- Parameters:
type
- 记忆类型- Returns:
- 是否为空
-
notEmpty
检查指定记忆类型数据是否不为空(null)- Parameters:
type
- 记忆类型- Returns:
- 是否不为空
-
compareDataTo
使用指定的数据对比记忆类型存储的数据- Parameters:
type
- 记忆类型to
- 指定的数据- Returns:
- 是否相同
-