Une classe tuile, sûrement utile
This commit is contained in:
		
							
								
								
									
										37
									
								
								Tuile.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								Tuile.java
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | |||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
|  | public class Tuile { | ||||||
|  | 	/*ATTRIBUTS*/ | ||||||
|  | 	private byte y; | ||||||
|  | 	private byte r; | ||||||
|  | 	private String color; | ||||||
|  | 	private List<Tuile> voisins = new List<Tuile>(); | ||||||
|  |  | ||||||
|  | 	/*METHODES*/ | ||||||
|  | 	public byte getY(){ | ||||||
|  | 		return this.y; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	public byte getR(){ | ||||||
|  | 		return this.r; | ||||||
|  | 	}  | ||||||
|  |  | ||||||
|  | 	public String getColor(){ | ||||||
|  | 		return this.color; | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	public void addVoisin(Tuile v){ | ||||||
|  | 		this.voisins.add(v); | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	public List<Tuile> getVoisins(){ | ||||||
|  | 		return this.voisins; | ||||||
|  | 	}   | ||||||
|  |  | ||||||
|  | 	/*CONSTRUCTEUR*/ | ||||||
|  | 	public Tuile(byte y, byte r, String c){ | ||||||
|  | 		this.y = y; | ||||||
|  | 		this.r = r; | ||||||
|  | 		this.color = c; | ||||||
|  | 	} | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user