package com.espritmobile.sim.restocheck.entities;

import java.util.List;

public class Person {

	private String name;
	private String color;
	private List<Element> elements;
	private double part;
	private double payed;
	private double rest;

	public Person() {
	}

	public Person(String name, String color, List<Element> elements,
			double part, double payed, double rest) {
		super();
		this.name = name;
		this.color = color;
		this.elements = elements;
		this.part = part;
		this.payed = payed;
		this.rest = rest;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public List<Element> getElements() {
		return elements;
	}

	public void setElements(List<Element> elements) {
		this.elements = elements;
	}

	public double getPart() {
		return part;
	}

	public void setPart(double part) {
		this.part = part;
		this.setPayed();
	}

	public double getPayed() {
		return payed;
	}

	public void setPayed() {
		this.payed = (Math.round((this.part / 10)) * 10);
		if (this.payed <= part && this.payed != this.part)
			this.payed += 10;
		this.setRest();

	}

	public double getRest() {
		return rest;
	}

	public void setRest() {
		this.rest = this.payed - this.part;
	}

}
