Shift from Game-Design
This commit is contained in:
commit
bb41a130ba
153 changed files with 4046 additions and 0 deletions
54
src/edu/utc/gamedev/Manager/ProjectileManager.java
Normal file
54
src/edu/utc/gamedev/Manager/ProjectileManager.java
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
package edu.utc.gamedev.Manager;
|
||||
|
||||
import edu.utc.gamedev.Entity.Projectile.EntityPotatoProjectile;
|
||||
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class ProjectileManager
|
||||
{
|
||||
private LinkedList<EntityPotatoProjectile> projectiles;
|
||||
|
||||
public ProjectileManager()
|
||||
{
|
||||
projectiles = new LinkedList<>();
|
||||
}
|
||||
|
||||
public void drawAll()
|
||||
{
|
||||
for (EntityPotatoProjectile e : projectiles)
|
||||
{
|
||||
e.draw();
|
||||
}
|
||||
}
|
||||
|
||||
public void updateAll(float delta)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (EntityPotatoProjectile e : projectiles)
|
||||
{
|
||||
e.update(delta);
|
||||
}
|
||||
}
|
||||
catch (ConcurrentModificationException e)
|
||||
{
|
||||
// We do nothing because nothing can be done ¯\_(ツ)_/¯
|
||||
}
|
||||
}
|
||||
|
||||
public void addProjectile(EntityPotatoProjectile e)
|
||||
{
|
||||
projectiles.add(e);
|
||||
}
|
||||
|
||||
public void removeProjectile(EntityPotatoProjectile e)
|
||||
{
|
||||
projectiles.remove(e);
|
||||
}
|
||||
|
||||
public LinkedList<EntityPotatoProjectile> getProjectiles()
|
||||
{
|
||||
return this.projectiles;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue