package math;

import nourriture.SacPatate;

public class NUplet{

	protected SacPatate [] NUp;
	
	public NUplet(SacPatate [] lisac){
		this.NUp= lisac;
	}
	
	public int size(){
		return this.NUp.length;
	}
	
	/* on entre en argument le coordonné de l'element a changer ds le NUPLET
	 */
	
	public void set(int i,SacPatate nouv){
		this.NUp[i]= nouv;
	}
	
	
	public SacPatate get(int i){
		return (this.NUp[i]);
	}
	
	public void concat(SacPatate [] list2){
		int l1,l2,i=0;
		
		l1=this.NUp.length;
		l2=list2.length;
		
		while(i < l2){
			this.NUp[l1+1+i]= list2[i];
		}
	}
	
	public void add(SacPatate [] lisac){
		int l1,l2,i=0;
		
		l1=this.NUp.length;
		l2=lisac.length;
		
		if(l1<l2){
			while (l1==l2){
				l1++;
				this.NUp[l1].poids = 0;
			}
		}
		if(l1>l2){
			while (l1==l2){
				l2++;
				lisac[l2].poids = 0;
			}
		}
		
		while (i<l1){
			this.NUp[i].poids=this.NUp[i].poids+lisac[i].poids;
		}
	}
	
}
