added friendly and neutral peg, added disposition
This commit is contained in:
@@ -24,7 +24,49 @@ public partial class Map : TileMapLayer
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public int _lastOpenRow
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = _maxY; i > _minY; i--)
|
||||
{
|
||||
if (!IsRowFull(i))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public int _firstOpenColumn
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < _maxX; i++)
|
||||
{
|
||||
if (!IsColumnnFull(i))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public int _lastOpenColumn
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = _maxX; i > _minX; i--)
|
||||
{
|
||||
if (!IsColumnnFull(i))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public override void _Ready()
|
||||
@@ -83,6 +125,13 @@ public partial class Map : TileMapLayer
|
||||
return hasOccupant || isSolid;
|
||||
}
|
||||
|
||||
public bool IsColumnnFull(int COLUMN_TO_CHECK)
|
||||
{
|
||||
List<Vector2I> rowCells = [.. _cells.Where(c => c.X == COLUMN_TO_CHECK)];
|
||||
|
||||
return rowCells.All(c => _astar.IsPointSolid(c));
|
||||
}
|
||||
|
||||
public bool IsRowFull(int ROW_TO_CHECK)
|
||||
{
|
||||
List<Vector2I> rowCells = [.. _cells.Where(c => c.Y == ROW_TO_CHECK)];
|
||||
|
||||
Reference in New Issue
Block a user