src/infinity/ecs/core/EntityManager.java
/**
	 * Adds new {@link Component}s of the specified types to the specified {@link Entity}.
	 * 
	 * @param entity The {@link Entity} to which the {@link Component}s should be added.
	 * @param componentTypes The types of {@link Component}s that should be added.
	 * @throws IllegalArgumentException When the specified {@link Entity} was not part of this
	 * 		{@link EntityManager} or if a new instance of one of the specified types of
	 * 		{@link Component}s could not be constructed.
	 * @throws ComponentAlreadyExistsException when one of the {@link Component}s which should be
	 * 		added is already part of the {@link Entity}.
	 */
Adds new  Components of the specified types to the specified  Entity.

@param entity The  Entity to which the  Components should be added.
@param componentTypes The types of  Components that should be added.
@throws IllegalArgumentException When the specified  Entity was not part of this
EntityManager or if a new instance of one of the specified types of
Components could not be constructed.
@throws ComponentAlreadyExistsException when one of the  Components which should be
added is already part of the  Entity.
Adds new Components of the specified types to the specified Entity . @param entity The Entity to which the Components should be added . @param componentTypes The types of Components that should be added . @throws IllegalArgumentException When the specified Entity was not part of this EntityManager or if a new instance of one of the specified types of Components could not be constructed . @throws ComponentAlreadyExistsException when one of the Components which should be added is already part of the Entity .
public void addComponents(Entity entity, ComponentType... componentTypes)
			throws IllegalArgumentException, ComponentAlreadyExistsException {
		int eId = entity.getId();
		IndexedCollection<Component> ec = _components.get(eId);
		if (ec == null)
			throw new IllegalArgumentException();
		for (ComponentType componentType : componentTypes) {
			int cId = componentType.getId();
			if (ec.get(cId) != null)
				throw new ComponentAlreadyExistsException();
			ComponentFactory fac = _factories.get(cId);
			if (fac == null)
				throw new IllegalArgumentException();
			Component c = fac.createNewComponent();
			ec.set(cId, c);
			c.bind(entity);
			_componentMasks.get(eId).add(componentType);
			if (_msgEndpoint != null)
				_msgEndpoint.send(new ComponentAddedMessage(c));
		}
	}
public void addComponents ( Entity entity , ComponentType ... componentTypes ) throws IllegalArgumentException , ComponentAlreadyExistsException { int eId = entity . getId ( ) ; IndexedCollection < Component > ec = _components . get ( eId ) ; if ( ec == null ) throw new IllegalArgumentException ( ) ; for ( ComponentType componentType : componentTypes ) { int cId = componentType . getId ( ) ; if ( ec . get ( cId ) != null ) throw new ComponentAlreadyExistsException ( ) ; ComponentFactory fac = _factories . get ( cId ) ; if ( fac == null ) throw new IllegalArgumentException ( ) ; Component c = fac . createNewComponent ( ) ; ec . set ( cId , c ) ; c . bind ( entity ) ; _componentMasks . get ( eId ) . add ( componentType ) ; if ( _msgEndpoint != null ) _msgEndpoint . send ( new ComponentAddedMessage ( c ) ) ; } }
Adds new {@link Component}s of the specified types to the specified {@link Entity}.
Adds new { @link Component } s of the specified types to the specified { @link Entity } .
// try to get the list of all components for the specified entity
 // check if there is already a component of the same type
 // try to get the factory which constructs components of the specified type
