Remove obsolete project files for MrGameEng.AI, MrGameEng.Assets, MrGameEng.Atlases, and MrGameEng.Collisions modules. Introduce new AssetManager and related classes for asset loading and management, including support for texture atlases and mod definitions. Enhance mod loading capabilities with DefDatabase and LanguageManager for JSON-based definitions and localization. Implement a shelf packing algorithm for efficient texture atlas creation.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using MrGameEng.Pathfinding;
|
||||
|
||||
namespace MrGameEng.Pathfinding.Tests;
|
||||
|
||||
/// <summary>Грид из строк: '#' — стена, '.' — клетка с ценой 1, '2'..'9' — клетка с этой ценой.</summary>
|
||||
public sealed class TestGrid : IPathGrid
|
||||
{
|
||||
private readonly string[] _rows;
|
||||
|
||||
public TestGrid(params string[] rows) => _rows = rows;
|
||||
|
||||
public int Width => _rows[0].Length;
|
||||
|
||||
public int Height => _rows.Length;
|
||||
|
||||
public bool IsPassable(int x, int y) => _rows[y][x] != '#';
|
||||
|
||||
public float Cost(int x, int y)
|
||||
{
|
||||
var cell = _rows[y][x];
|
||||
return cell is >= '2' and <= '9' ? cell - '0' : 1f;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user