public WaterCell GetCell(int x, int y) { if (PipeGrid.IsPipe(x, y)) { return(WaterArray[x, y]); } else { return(null); } }
public void SetNeighbors() { if (PipeGrid.IsPipe(X, Y - 1)) { Up = PipeGrid.WaterField.GetCell(X, Y - 1); } if (PipeGrid.IsPipe(X, Y + 1)) { Down = PipeGrid.WaterField.GetCell(X, Y + 1); } if (PipeGrid.IsPipe(X - 1, Y)) { Left = PipeGrid.WaterField.GetCell(X - 1, Y); } if (PipeGrid.IsPipe(X + 1, Y)) { Right = PipeGrid.WaterField.GetCell(X + 1, Y); } }