Package cn.nukkit.entity.ai.memory
Class MemoryStorage
java.lang.Object
cn.nukkit.entity.ai.memory.MemoryStorage
- All Implemented Interfaces:
IMemoryStorage
@PowerNukkitXOnly
@Since("1.19.50-r1")
public class MemoryStorage
extends Object
implements IMemoryStorage
记忆存储器标准实现
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Object
protected Entity
protected Map<MemoryType<?>,
Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(MemoryType<?> type) 清空指定记忆类型数据为null<D> D
get
(MemoryType<D> type) 从指定记忆类型获取数据Map<MemoryType<?>,
?> getAll()
获取所有记忆获取记忆存储所属的实体<D> void
put
(MemoryType<D> type, D data) 写入数据到记忆类型Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.entity.ai.memory.IMemoryStorage
compareDataTo, encode, isEmpty, notEmpty
-
Field Details
-
EMPTY_VALUE
-
memoryMap
-
entity
-
-
Constructor Details
-
MemoryStorage
-
-
Method Details
-
put
Description copied from interface:IMemoryStorage
写入数据到记忆类型Write data to MemoryType
- Specified by:
put
in interfaceIMemoryStorage
- Type Parameters:
D
- 数据类型- Parameters:
type
- 记忆类型data
- 数据
-
get
Description copied from interface:IMemoryStorage
从指定记忆类型获取数据Get data from the specified MemoryType
- Specified by:
get
in interfaceIMemoryStorage
- Type Parameters:
D
- 数据类型- Parameters:
type
- 记忆类型- Returns:
- 数据
-
getAll
Description copied from interface:IMemoryStorage
获取所有记忆get all memories
- Specified by:
getAll
in interfaceIMemoryStorage
- Returns:
- 所有记忆
-
clear
Description copied from interface:IMemoryStorage
清空指定记忆类型数据为nullClear the specified MemoryType data to null
- Specified by:
clear
in interfaceIMemoryStorage
- Parameters:
type
- 记忆类型
-
getEntity
Description copied from interface:IMemoryStorage
获取记忆存储所属的实体Get the entity that the memory store belongs to
- Specified by:
getEntity
in interfaceIMemoryStorage
- Returns:
- 实体
-