Package cn.nukkit.entity.ai.memory
Interface IMemoryStorage
- All Known Implementing Classes:
MemoryStorage
记忆存储器
memory storage
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(MemoryType<?> type) 清空指定记忆类型数据为nulldefault <D> boolean
compareDataTo
(MemoryType<D> type, Object to) 使用指定的数据对比记忆类型存储的数据default void
encode()
将此记忆存储器的数据编码进所属实体NBT(若MemoryType附加有编解码器)<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
写入数据到记忆类型Write data to MemoryType
- Type Parameters:
D
- 数据类型- Parameters:
type
- 记忆类型data
- 数据
-
get
从指定记忆类型获取数据Get data from the specified MemoryType
- Type Parameters:
D
- 数据类型- Parameters:
type
- 记忆类型- Returns:
- 数据
-
getAll
Map<MemoryType<?>,?> getAll()获取所有记忆get all memories
- Returns:
- 所有记忆
-
clear
清空指定记忆类型数据为nullClear the specified MemoryType data to null
- Parameters:
type
- 记忆类型
-
getEntity
获取记忆存储所属的实体Get the entity that the memory store belongs to
- Returns:
- 实体
-
isEmpty
检查指定记忆类型数据是否为空(null)Check if the specified memory type data is empty (null)
- Parameters:
type
- 记忆类型- Returns:
- 是否为空
-
notEmpty
检查指定记忆类型数据是否不为空(null)Check if the specified memory type data is not empty (null)
- Parameters:
type
- 记忆类型- Returns:
- 是否不为空
-
compareDataTo
使用指定的数据对比记忆类型存储的数据Use the specified data compare the data of memory type
- Parameters:
type
- 记忆类型to
- 指定的数据- Returns:
- 是否相同
-
encode
default void encode()将此记忆存储器的数据编码进所属实体NBT(若MemoryType附加有编解码器)Encode the data of this memory storage into the entity NBT (if there is a codec attached to the Memory Type)
-