import java.awt.Graphics; public class Kolmnurk implements Kujund{ Joon j1, j2, j3; public Kolmnurk(int ux1, int uy1, int ux2, int uy2, int ux3, int uy3){ j1=new Joon(ux1, uy1, ux2, uy2); j2=new Joon(ux2, uy2, ux3, uy3); j3=new Joon(ux3, uy3, ux1, uy1); } public void joonista(Graphics g){ j1.joonista(g); j2.joonista(g); j3.joonista(g); } public boolean kasPihtas(int hx, int hy){ if(j1.kasPihtas(hx, hy)){return true;} if(j2.kasPihtas(hx, hy)){return true;} if(j3.kasPihtas(hx, hy)){return true;} return false; } }