TextEntityCounter.java
01 package rtype.entity;
02 
03 import rtype.Prototyp;
04 
05 public class TextEntityCounter extends Text {
06 
07   public TextEntityCounter()
08   {
09     super("");
10   }
11   
12   public TextEntityCounter(String string) {
13     super(string);
14   
15   }
16 
17   public void update()
18   {
19     super.update();
20     int entitiesCounter = 0;
21       entitiesCounter += Prototyp.bullets.entities.size();
22       entitiesCounter += Prototyp.enemies.entities.size();
23     entitiesCounter += Prototyp.fx.entities.size();
24     entitiesCounter += Prototyp.background.entities.size();
25     entitiesCounter += Prototyp.frontground.entities.size();
26     
27     setString("Entities #:"+entitiesCounter);
28   }
29 }