Package com.tankz.systems.misc

Source Code of com.tankz.systems.misc.AmmoRegenerationSystem

package com.tankz.systems.misc;

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.systems.IntervalEntityProcessingSystem;
import com.tankz.components.Ammo;

public class AmmoRegenerationSystem extends IntervalEntityProcessingSystem {

  private ComponentMapper<Ammo> ammoMapper;

  public AmmoRegenerationSystem() {
    super(Aspect.getAspectFor(Ammo.class), 100);
  }

  @Override
  public void initialize() {
    ammoMapper = world.getMapper(Ammo.class);
  }
 
  protected void process(Entity e) {
    Ammo ammo = ammoMapper.get(e);
    ammo.addAmmo(1);
  }
 
}
TOP

Related Classes of com.tankz.systems.misc.AmmoRegenerationSystem

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.