Group Class
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
()
Methods
addObject
(
-
obj
Add obj to this group
Parameters:
-
obj
NetObjectThe NetObject to add to this group.
obj
will be sent over all connections which have this group.
removeObject
(
-
obj
Remove obj from this group
Parameters:
-
obj
NetObject | NumberThe 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
The objects contained in this group