package space;

import java.util.ArrayList;
import java.util.List;

import com.jln.ld.GameEntity;
import com.jln.ld.Shared;

import menus.GameMenu;

public class Space {

	private List<Star> stars1;
	private List<Star> stars2;
	private List<Planet> planets;
	
	public Space(){
		stars1 = new ArrayList<Star>();
		stars2 = new ArrayList<Star>();
		planets = new ArrayList<Planet>();
		planets.add(new Planet());
		for(int i=0;i<32;i++){
			stars1.add(new Star(true));
		}
		for(int i=0;i<16;i++){
			stars2.add(new Star(false));
		}
	}
	
	/**
	 * ==========================================
	 * == MISE A JOUR DE L'OBJET               ==
	 * ==========================================
	 */
	public void update() {
		for (Star star : stars1) {
			star.update();
		}
		for (Star star : stars2) {
			star.update();
		}
		for (Planet planet : planets) {
			planet.update();
		}
	}

	/**
	 * ==========================================
	 * == DESSIN DE L'OBJET                    ==
	 * ==========================================
	 */
	public void render() {
		Shared.GAME_BATCH.draw(Shared.SPACE_BACKGROUND, 0+Shared.DECAL_X,-4+Shared.DECAL_Y);
		for (Star star : stars1) {
			star.render();
		}
		for (Star star : stars2) {
			star.render();
		}
		for (Planet planet : planets) {
			planet.render();
		}
	}

}
