package starpunk.logic.systems;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.EntitySystem;
import com.artemis.annotations.Mapper;
import com.artemis.managers.TagManager;
import com.artemis.utils.ImmutableBag;
import starpunk.logic.PlayerInput;
import starpunk.logic.components.Acceleration;

public final class PlayerMovementSystem
  extends EntitySystem
{
  private static final float MAX_ACCELERATION = 10;

  @Mapper
  ComponentMapper<Acceleration> _accelerationMapper;
  private Entity _player;

  public PlayerMovementSystem()
  {
    super( Aspect.getAspectForAll() );
  }

  @Override
  public void initialize()
  {
    ensurePlayerEntity();
  }

  @Override
  protected void processEntities( final ImmutableBag<Entity> entities )
  {
    ensurePlayerEntity();

    if( null != _player )
    {
      updatePlayer( _player );
    }
  }

  @Override
  protected boolean checkProcessing()
  {
    return true;
  }

  private void ensurePlayerEntity()
  {
    if( null == _player || !_player.isActive() )
    {
      _player = world.getManager( TagManager.class ).getEntity( "PLAYER" );
    }
  }

  protected void updatePlayer( Entity e )
  {
    final Acceleration acceleration = _accelerationMapper.get( e );

    final PlayerInput input = PlayerInput.getPlayerInput();
    acceleration.setVectorX( input.isLeft() ? -MAX_ACCELERATION : input.isRight() ? MAX_ACCELERATION : 0 );
    acceleration.setVectorY( input.isUp() ? MAX_ACCELERATION : input.isDown() ? -MAX_ACCELERATION : 0 );
  }
}

@@ -30,35 +30,8 @@
 s;%0A%0A
-import com.artemis.Aspect;%0A
 impo
@@ -93,41 +93,8 @@
 ty;%0A
-import com.artemis.EntitySystem;%0A
 impo
@@ -191,26 +191,32 @@
 mis.
-utils.ImmutableBag
+systems.VoidEntitySystem
 ;%0Aim
@@ -346,16 +346,20 @@
 extends 
+Void
 EntitySy
@@ -514,242 +514,49 @@
 %0A%0A  
-public PlayerMovementSystem()%0A  %7B%0A    super( Aspect.getAspectForAll() );%0A  %7D%0A%0A  @Override%0A  public void initialize()%0A  %7B%0A    ensurePlayerEntity();%0A  %7D%0A%0A  @Override%0A  protected void processEntities( final ImmutableBag%3CEntity%3E entities 
+@Override%0A  protected void processSystem(
 )%0A  
@@ -662,84 +662,8 @@
  %7D%0A%0A
-  @Override%0A  protected boolean checkProcessing()%0A  %7B%0A    return true;%0A  %7D%0A%0A
   pr

Simplify to use a void system instead