All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.entity.ai.sensor.ISensor Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.entity.ai.sensor;

import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;
import cn.nukkit.entity.EntityIntelligent;
import cn.nukkit.entity.ai.memory.IMemoryStorage;

/**
 * 此接口抽象了一个传感器 
* 传感器用于搜集环境信息并向记忆存储器{@link IMemoryStorage}写入一个记忆{@link cn.nukkit.entity.ai.memory.MemoryType} *

* This interface abstracts a sensor
* The sensor is used to collect environmental information and write a memory {@link cn.nukkit.entity.ai.memory.MemoryType} to the memory storage {@link IMemoryStorage} */ @PowerNukkitXOnly @Since("1.6.0.0-PNX") public interface ISensor { /** * @param entity 目标实体 */ void sense(EntityIntelligent entity); /** * 返回此传感器的刷新周期,小的刷新周期会使得传感器被更频繁的调用 *

* Returns the refresh period of this sensor, a small refresh period will make the sensor be called more frequently * * @return 刷新周期 */ default int getPeriod() { return 1; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy