API Docs for:
Show:

Group Class

Defined in: src/group.js:1

Group of objects used to manage visibility at a per-connection level. Connections can have zero or more visibility groups.

var group = Wasabi.createGroup();
var conn1 = Wasabi.addClient(socket1);
var conn2 = Wasabi.addClient(socket2);

conn1.addGroup(group);
conn2.addGroup(group);
// foo will be sent to both connections
group.addObject(foo);

Constructor

Group

()

Defined in src/group.js:1

Item Index

Properties

Methods

addObject

(
  • obj
)

Defined in src/group.js:27

Add obj to this group

Parameters:

  • obj NetObject

    The NetObject to add to this group. obj will be sent over all connections which have this group.

removeObject

(
  • obj
)

Defined in src/group.js:37

Remove obj from this group

Parameters:

  • obj NetObject | Number

    The NetObject or index to remove from this group. obj will be removed from any connection which no longer has it through any group.

Properties

_objects

Array private

Defined in src/group.js:18

The objects contained in this group