import javax.swing.*;

import startypes.Star;
import startypes.StarFactory;
import startypes.StarType;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

public class Sky extends JFrame {
    private List<Star> stars = new ArrayList<>();

    public void placeStar(int x, int y, StarType s) {
        StarType instance = StarFactory.getStarType(s.getName(), s.getSize(), s.getColor() );
        Star star = new Star(x, y, instance);
        stars.add(star); 
    }
    
    @Override
    public void paint(Graphics graphics) {
        for (Star star : stars) {
            star.draw(graphics);
        }
    }
}