package model.agent;

import model.Reference;
import controller.GestionAgent;


public abstract class Agent implements java.io.Serializable{

	private static final long serialVersionUID = 6673831126464961812L;
	
	////////// Attributs //////////
	
	protected String nom;
	protected String reference;

	////////// Constructeur //////////
	
	public Agent(String nom, String type) {
		this.nom = nom;
		if (type.equals("CLI")) {
			this.reference = Reference.genererReference(type, GestionAgent.cptClients);
			GestionAgent.cptClients++;
		}
		else if (type.equals("FOU")) {
			this.reference = Reference.genererReference(type, GestionAgent.cptFournisseurs);
			GestionAgent.cptFournisseurs++;
		}
	}
	
	////////// Getters et setters //////////
	
	public String getNom() {
		return nom;
	}
	public void setNom(String nom) {
		this.nom = nom;
	}
	public String getReference() {
		return reference;
	}
	public void setReference(String reference) {
		this.reference = reference;
	}
	
	////////// Methodes //////////
	
}
