Skip to content

1681-engine / index / RoomInterest

Interface: RoomInterest<D, B> ​

Defined in: src/net/Room.ts:51

Who a player is sent: the bodies near it, not the whole room.

Type Parameters ​

Type ParameterDefault type
D-
Bunknown

Properties ​

canSee? ​

ts
optional canSee?: (viewer, other) => boolean;

Defined in: src/net/Room.ts:60

A further test, for what distance alone does not decide (a team's own always, a hidden enemy never).

Parameters ​

ParameterType
viewerRoomPlayer<D>
otherRoomSeen<D, B>

Returns ​

boolean


leaveMargin? ​

ts
optional leaveMargin?: number;

Defined in: src/net/Room.ts:58

And leaves only past radius + leaveMargin (default a quarter of radius), so a body walking along the edge is not spawned and removed on every snapshot.


radius ​

ts
radius: number;

Defined in: src/net/Room.ts:53

A body comes into view within this many px of the player (centre to centre).

Released under the MIT License.