跳转到正文

positions API ​

完整接口目录 · 玩家查询用法 · 工具包下载

模块说明 ​

text
Bounded sampled positions and zones; samples are not durable movement events.

Zone ​

python
@dataclass(frozen=True)
class Zone

字段(包含继承字段):

Zone.name ​

python
name: str

数据类字段;声明于 positions.Zone。

Zone.dimension ​

python
dimension: int

数据类字段;声明于 positions.Zone。

Zone.minimum ​

python
minimum: tuple

数据类字段;声明于 positions.Zone。

Zone.maximum ​

python
maximum: tuple

数据类字段;声明于 positions.Zone。

Zone.contains ​

python
def contains(self, dimension, position)

ZoneTracker ​

python
class ZoneTracker

SDK 说明:

text
At most 64 entities × 64 boxes; absence is lost, never a leave reward.

A first observed presence emits enter (also after reset/reload). Changes
between samples can be missed. Consumers must persist business eligibility.

ZoneTracker.__init__ ​

python
def __init__(self, zones)

ZoneTracker.update ​

python
def update(self, snapshot)

ZoneTracker.reset ​

python
def reset(self)

ZoneTracker.zones ​

python
self.zones

公开实例属性,在 __init__ 中设置。

PositionSampler ​

python
class PositionSampler

PositionSampler.__init__ ​

python
def __init__(self, ctx)

PositionSampler.sample ​

python
async def sample(self, *, timeout=5, **selection)

SDK 说明:

text
One batch query with its durable operation ID; failed reads raise.

PositionSampler.watch ​

python
def watch(self, zones, callback, *, interval=1.0, timeout=5, **selection)

SDK 说明:

text
One supervised serial task; no queued polls, coalesced changes per sample.

PositionSampler.ctx ​

python
self.ctx

公开实例属性,在 __init__ 中设置。

Neomega · 使用、开发与参考文档