reverting to previous version

This commit is contained in:
2026-06-02 01:30:51 -04:00
parent dd14a8da40
commit bc65b5170e
7 changed files with 141 additions and 19 deletions
+8 -3
View File
@@ -34,7 +34,7 @@ public partial class GridMap2D : Node2D
for (int j = 0; j < _sizeInCells.X; j++)
{
GridMarker newGridMarker = (GridMarker)_gridMarker.Duplicate();
newGridMarker._address = new Vector2(j, i);
newGridMarker._address = new Vector2I(j, i);
newGridMarker.Position = new Vector2(_playArea.Position.X - playAreaBounds.Shape.GetRect().Size.X / 2 + (j+.5f)*_cellSize, _playArea.Position.Y - playAreaBounds.Shape.GetRect().Size.Y / 2 + (i+.5f)*_cellSize);
_gridMarkers[i].Add(newGridMarker);
AddChild(newGridMarker);
@@ -67,8 +67,13 @@ public partial class GridMap2D : Node2D
return _gridMarkers[COORDINATES.Y][COORDINATES.X];
}
public GridMarker GetGridMarkerRelativeToAnother(GridMarker GRID_MARKER, Vector2I STEP)
public GridMarker GetMarkerFromOffset(GridMarker GRID_MARKER, Vector2I STEP)
{
return _gridMarkers[(int)GRID_MARKER._address.Y + STEP.Y][(int)GRID_MARKER._address.X + STEP.X];
return _gridMarkers[GRID_MARKER._address.Y + STEP.Y][GRID_MARKER._address.X + STEP.X];
}
public List<GridMarker> GetMarkerInRange(GridMarker GRID_MARKER, int RANGE)
{
return [.. _gridMarkers.SelectMany(m => m).Where(m => (GRID_MARKER._address - m._address).Length() <= RANGE).Cast<GridMarker>()];
}
}