refactor
This commit is contained in:
parent
4424f4c3a8
commit
0e7de0a5f3
281 changed files with 3188 additions and 611 deletions
15
src/Nexus.Core/WalkabilitySnapshot.cs
Normal file
15
src/Nexus.Core/WalkabilitySnapshot.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
namespace Nexus.Core;
|
||||
|
||||
public record WalkabilitySnapshot
|
||||
{
|
||||
public int Width { get; init; }
|
||||
public int Height { get; init; }
|
||||
public byte[] Data { get; init; } = [];
|
||||
|
||||
public bool IsWalkable(int x, int y)
|
||||
{
|
||||
if (x < 0 || x >= Width || y < 0 || y >= Height)
|
||||
return false;
|
||||
return Data[y * Width + x] != 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue