diff --git a/src/main/GridStuff.java b/src/main/GridStuff.java new file mode 100644 index 0000000..32866fa --- /dev/null +++ b/src/main/GridStuff.java @@ -0,0 +1,57 @@ +package main; + + +import main.Controller; +import javafx.scene.paint.Color; +import javafx.scene.shape.Rectangle; +import javafx.scene.canvas.Canvas; +import javafx.scene.canvas.GraphicsContext; + + +public class GridStuff{ + + int red = 1; + int yellow = -1; + int white = 0; + + private double canvasWidth = 769; + private double canvasHeight = 769; + + private double n = 10; + private double m = 10; + + double getWidth = canvasWidth / 10; + double getHeight = canvasHeight /10; + + GridStuff [][] map = new GridStuff[(int) n][(int) m]; + + //void draw(); + //void setZoom(double z); + + public GridStuff(Canvas canvas, double zoom){ + GraphicsContext gc = canvas.getGraphicsContext2D(); + + for( int i=0; i < n; i++) { + for( int j=0; j < m; j++) { + //if(condition 1){ + gc.setFill(Color.BLACK); + gc.fillRect(i*getWidth, j*getHeight, getWidth, getHeight); + gc.setFill(Color.INDIANRED); + gc.fillRect(i*getWidth, j*getHeight, getWidth - 2, getHeight - 2); + //} + /*if(condition 2){ + gc.setFill(Color.BLACK); + gc.fillRect(i*getWidth, j*getHeight, getWidth, getHeight); + gc.setFill(Color.WHITE); + gc.fillRect(i*getWidth, j*getHeight, getWidth - 2, getHeight - 2); + } + if(condition 3){ + gc.setFill(Color.BLACK); + gc.fillRect(i*getWidth, j*getHeight, getWidth, getHeight); + gc.setFill(Color.LIGHTGOLDENRODYELLOW); + gc.fillRect(i*getWidth, j*getHeight, getWidth - 2, getHeight - 2); + }*/ + } + } + } +}