package code.kalter.longflight.game.ship; import code.kalter.longflight.Loader; import code.kalter.longflight.LongFlight; import java.io.IOException; import javax.microedition.lcdui.Image; /** * Все свойства корабликов игрока * * @author KalterFive */ public class ShipGamer implements Ship { private static ShipGamer instance; public static ShipGamer getInstance() throws IOException { if (instance == null) { instance = new ShipGamer(); } return instance; } private final int[] life; private final int[] time; private final int[] acceleration; private final int[] velocityMax; private final int[] deltaFire; private final int[] speedOverheat; private final Image[] image; public ShipGamer() throws IOException { life = new int[COUNT]; time = new int[COUNT]; acceleration = new int[COUNT]; velocityMax = new int[COUNT]; deltaFire = new int[COUNT]; speedOverheat = new int[COUNT]; image = new Image[COUNT]; Loader imageLoader = Loader.getInstance(); //TYPE: LAX life[LAX] = 3; time[LAX] = 2; acceleration[LAX] = 2; velocityMax[LAX] = 6; deltaFire[LAX] = 250; speedOverheat[LAX] = 4; image[LAX] = imageLoader.getImage("/gfx/ship/" + LAX + ".png"); //TYPE: POWERFUL life[POWERFUL] = 10; time[POWERFUL] = 2; acceleration[POWERFUL] = 2; velocityMax[POWERFUL] = 4; deltaFire[POWERFUL] = 300; speedOverheat[POWERFUL] = 4; image[POWERFUL] = imageLoader.getImage("/gfx/ship/" + POWERFUL + ".png"); //TYPE: UNIVERSAL life[UNIVERSAL] = 5; time[UNIVERSAL] = 2; acceleration[UNIVERSAL] = 2; velocityMax[UNIVERSAL] = 8; deltaFire[UNIVERSAL] = 200; speedOverheat[UNIVERSAL] = 4; image[UNIVERSAL] = imageLoader.getImage("/gfx/ship/" + UNIVERSAL + ".png"); //TYPE: STRONG life[STRONG] = 6; time[STRONG] = 4; acceleration[STRONG] = 4; velocityMax[STRONG] = 24; deltaFire[STRONG] = 200; speedOverheat[STRONG] = 4; image[STRONG] = imageLoader.getImage("/gfx/ship/" + STRONG + ".png"); } public int getLife(int type) { return life[type]; } public int getTime(int type) { return time[type]; } public int getAcceleration(int type) { return acceleration[type]; } public int getVelocityMax(int type) { return velocityMax[type]; } public int getDeltaFire(int type) { return deltaFire[type]; } public int getSpeedOverheat(int type) { return speedOverheat[type]; } public Image getImage(int type) { return image[type]; } }