IgeObject

Method: removeGroup

Removes the entity from the group or groups passed. This method accepts multiple arguments and will remove the entity from all groups passed as arguments.
removeGroup (* groupName)
  • *groupName The name of the group or array of group names to remove this entity as a member of.
Returns *

Remove entity from single group

var entity = new IgeEntity();
entity.addGroup('g1', 'g2');

// This will output "['g1', 'g2']"
console.log(entity.groups());

// Remove entity from a single group
entity.removeGroup('g1');

// This will output "['g2']"
console.log(entity.groups());

Remove entity from multiple groups

var entity = new IgeEntity();
entity.addGroup('g1', 'g3', 'g2');

// This will output "['g1', 'g3', 'g2']"
console.log(entity.groups());

// Remove entity from multiple groups
entity.removeGroup('g1', 'g3');

// This will output "['g2']"
console.log(entity.groups());

Remove entity from multiple groups via an array

var entity = new IgeEntity();
entity.addGroup('g1', 'g3', 'g2');

// This will output "['g1', 'g3', 'g2']"
console.log(entity.groups());

// Remove entity from multiple groups
entity.removeGroup(['g1', 'g3']);

// This will output "['g2']"
console.log(entity.groups());

Remove entity from multiple groups via multiple arrays

var entity = new IgeEntity();
entity.addGroup('g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7');

// This will output "['g1', 'g2', 'g3', 'g4', 'g5', 'g6', 'g7']"
console.log(entity.groups());

// Remove entity from multiple groups
entity.removeGroup(['g1', 'g3'], ['g5', 'g6', 'g7']);

// This will output "['g2', 'g4']"
console.log(entity.groups());
© Copyright 2013 Irrelon Software Limited. All Rights Reserved. UK Registered Company Number: 07522767
Isogenic (ī´sōjen´ik): Adj originating from a common source; possessing the same genetic composition.
Strange Things Happen at the One Two Point