import java.util.ArrayList;
import java.util.List;
import wheels.users.Rectangle;

public class Points extends Rectangle
{
	private int point = 0;
	private List<Rectangle> bar = new ArrayList<Rectangle>();
	
	public Points()
	{
		
	}
	
	public void add(final int points)
	{
		this.point += points;
		
		if (this.point >= 10)
		{
			bar.add(generate());
			this.point %= 10;
		}
	}
	
	public int points()
	{
		return this.bar.size();
	}
	
	private Rectangle generate()
	{
		Rectangle temporary = new Rectangle(java.awt.Color.orange);
		temporary.setLocation(Window._dp.getWidth() - 25 - (bar.size() * 12), 20);
		temporary.setSize(5, 20);
		
		return temporary;
	}
}
