Add modification operations to control groups
@@ -14,3 +14,17 @@ class ControlGroup(set):
@property
def empty(self):
return self.amount == 0
+
+ def add_unit(self, units):
+ self.add(unit.tag)
+
+ def add_units(self, units):
+ for unit in units:
+ self.add_unit(unit)
+
+ def remove_unit(self, units):
+ self.remove(unit.tag)
+
+ def remove_units(self, units):
+ for unit in units:
+ self.remove(unit.tag)
