package donnu.zolotarev.SpaceShip.Levels;

import donnu.zolotarev.SpaceShip.Waves.IAddedEnemy;
import donnu.zolotarev.SpaceShip.Waves.IWaveController;
import donnu.zolotarev.SpaceShip.Waves.SimpleWave;
import donnu.zolotarev.SpaceShip.Waves.UnitWave;

public  class WaveContainer {
    public static final int LEVEL_INFINITY = 99;
    public static final int LEVEL_TEST = 100;

    public static final int LEVEL_1 = 1;
    public static final int LEVEL_2 = LEVEL_1+1;
    public static final int LEVEL_3 = LEVEL_2+1;
    public static final int LEVEL_4 = LEVEL_3+1;
    public static final int LEVEL_5 = LEVEL_4+1;
    public static final int LEVEL_6 = LEVEL_5+1;
    public static final int LEVEL_7 = LEVEL_6+1;
    public static final int LEVEL_8 = LEVEL_7+1;
    public static final int LEVEL_9 = LEVEL_8+1;


    public static IWaveController getWaveControllerById(int id,IAddedEnemy iAddedEnemy){
        return get(id,iAddedEnemy);
    }

    private static IWaveController get(int id,IAddedEnemy iAddedEnemy) {
        SimpleWave waveController;
        UnitWave unitWave;
        switch (id){
            case LEVEL_TEST:
                waveController = new SimpleWave();
                unitWave = new UnitWave(iAddedEnemy);
                unitWave.addEnemy(0, 1, 0.2f);
                waveController.addWave(unitWave);
                return waveController;
            case LEVEL_1:
                waveController = new SimpleWave();
                unitWave = new UnitWave(iAddedEnemy);
                unitWave.addEnemy(0, 5, 2.0f);
                unitWave.addEnemy(0, 4, 1.4f);
                unitWave.addEnemy(0, 3, 0.2f);
                waveController.addWave(unitWave);
                return waveController;
            case LEVEL_2:
                waveController = new SimpleWave();

                unitWave = new UnitWave(iAddedEnemy);
                unitWave.addEnemy(0, 5, 1.5f);
                unitWave.addEnemy(0, 5, 1.4f);
                unitWave.addEnemy(0, 3, 0.3f);
                waveController.addWave(unitWave);
                return waveController;
           // case LEVEL_3:
            default:
                waveController = new SimpleWave();

                unitWave = new UnitWave(iAddedEnemy);
                unitWave.addEnemy(0, 1 + id, 1f+(id%2/5f));
                unitWave.addEnemy(0, 5, 1.2f);
                unitWave.addEnemy(0,5 + id,0.9f);
                waveController.addWave(unitWave);
                int waveCount = (id+1)/3;
                for (int i = 0; i<waveCount; i++) {
                    unitWave = new UnitWave(iAddedEnemy);
                    unitWave.addEnemy(0, 2 + i, 1.5f - i/10f);
                    unitWave.addEnemy(0, 5*i, 1.5f - i/10f);
                    unitWave.addEnemy(0, 2 + 2*i, 1.5f - i/10f);
                    unitWave.addEnemy(0, 0, 5f + i);
                    waveController.addWave(unitWave);
                }

                return waveController;
            /*default:
                new Exception("Undefine id of wave controller");*/
        }
        //return null;
    }

}

@@ -1535,17 +1535,17 @@
 y(0, 5, 
-2
+3
 .0f);%0A  
@@ -1582,19 +1582,19 @@
 y(0, 4, 
-1.4
+2.0
 f);%0A    
@@ -1899,17 +1899,17 @@
 0, 5, 1.
-5
+7
 f);%0A    
@@ -1945,14 +1945,14 @@
 (0, 
-5
+6
 , 1.
-4
+9
 f);%0A
@@ -1993,17 +1993,17 @@
 0, 3, 0.
-3
+5
 f);%0A    
@@ -2288,16 +2288,18 @@
  + id, 1
+.2
 f+(id%252/
@@ -2346,21 +2346,59 @@
 0, 5, 1.
-2
+3
 f);%0A
+                unitWave.addDelay(4);%0A
         
@@ -2436,11 +2436,9 @@
  id,
-0.9
+1
 f);%0A
@@ -2685,25 +2685,25 @@
 0, 2 + i, 1.
-5
+6
 f - i/10f);%0A
@@ -2744,27 +2744,25 @@
 emy(0, 5*i, 
-1.5
+2
 f - i/10f);%0A
@@ -2753,32 +2753,33 @@
 i, 2f - i/10f);%0A
+%0A
                 
@@ -2814,17 +2814,17 @@
  2*i, 1.
-5
+8
 f - i/10
@@ -2863,20 +2863,14 @@
 .add
-Enemy(0, 0, 
+Delay(
 5f +

change balance