How do I subtract Cell[3,5] from Cell[5,4]?? I have a cell Object which creates a 2D array and set warrior Object in it. I tried this but it didnot work
Cell[,] cells = new Cell[6,6];
cells[3, 5] = new Cell(warrior);
cells[5,4] = new Cell(warrior);
...
int x1 = cells[3, 5].x - cells[5, 4].x;
int x2 = cells[3, 5].y - cells[5, 4].y;
Console.WriteLine(x1);
Console.WriteLine(x2);
My Cell class is like this:
public class Cell { public int _x; public int _y; public Warrior _warrior; }
I tried this but id didnot work?Could you explain more?Cell(Warrior warrior)??