class ComponentModifier<T> {
final ComponentType type;
final ModifyComponent<T> modifyComponent;
//TODO use generic to define ctype and secure that ctype == T
//(see https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/tests/language/type_parameter_literal_test.dart)
ComponentModifier(Type ctype, this.modifyComponent) : type = ComponentTypeManager.getTypeFor(ctype);
void applyE(Entity e) {
var c = e.getComponent(type);
applyC(e.getComponent(type));
}
void applyC(T c) {
if (c != null) modifyComponent(c);
}
}