package depart.commun.modeles;

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

import ca.ntro.app.models.Model;
import ca.ntro.app.models.WatchJson;
import ca.ntro.app.models.WriteObjectGraph;
import depart.commun.valeurs.ValeurA;
import depart.frontal.vues.VueA;

public class ModeleA implements Model, WatchJson, WriteObjectGraph {

	private boolean attrA = false;
	private double  attrB = 10.0;

	private List<ValeurA> valeurs = new ArrayList<>();

	public void methodeC(VueA vueA) {

		vueA.methodeA(this.toString());
	}
	
	public String toString() {

		StringBuilder builder = new StringBuilder();

		builder.append("attrA: " + attrA);
		builder.append(System.lineSeparator());

		builder.append("attrB: " + attrB);
		builder.append(System.lineSeparator());
		builder.append(System.lineSeparator());
		
		builder.append("valeurs: ");
		builder.append(System.lineSeparator());

		for(ValeurA valeur : valeurs) {

			builder.append("  ");
			builder.append(valeur.toString());
			builder.append(System.lineSeparator());
		}

		return builder.toString();
	}

}
