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 Details

  • Constructor Details

    • MemoryStorage

      public MemoryStorage()
  • Method Details

    • put

      public <D> void put(MemoryType<D> type, D data)
      Description copied from interface: IMemoryStorage
      写入数据到记忆类型
      Specified by:
      put in interface IMemoryStorage
      Type Parameters:
      D - 数据类型
      Parameters:
      type - 记忆类型
      data - 数据
    • get

      public <D> D get(MemoryType<D> type)
      Description copied from interface: IMemoryStorage
      从指定记忆类型获取数据
      Specified by:
      get in interface IMemoryStorage
      Type Parameters:
      D - 数据类型
      Parameters:
      type - 记忆类型
      Returns:
      数据
    • getAll

      public Map<MemoryType<?>,?> getAll()
      Description copied from interface: IMemoryStorage
      获取所有记忆
      Specified by:
      getAll in interface IMemoryStorage
      Returns:
      所有记忆
    • clear

      public void clear(MemoryType<?> type)
      Description copied from interface: IMemoryStorage
      清空指定记忆类型数据为null
      Specified by:
      clear in interface IMemoryStorage
      Parameters:
      type - 记忆类型