separate folders per functionality

This commit is contained in:
Vinzenz Schroeter 2024-04-10 19:25:45 +02:00
commit 0ca6a91a7e

View file

@ -0,0 +1,42 @@
namespace TanksServer.GameLogic;
internal sealed class MapService
{
public const int TilesPerRow = 44;
public const int TilesPerColumn = 20;
public const int TileSize = 8;
public const int PixelsPerRow = TilesPerRow * TileSize;
public const int PixelsPerColumn = TilesPerColumn * TileSize;
private readonly string _map =
"""
############################################
#...................##.....................#
#...................##.....................#
#.....####......................####.......#
#..........................................#
#............###...........###.............#
#............#...............#.............#
#...##.......#...............#......##.....#
#....#..............................#......#
#....#..##......................##..#......#
#....#..##......................##..#......#
#....#..............................#......#
#...##.......#...............#......##.....#
#............#...............#.............#
#............###...........###.............#
#..........................................#
#.....####......................####.......#
#...................##.....................#
#...................##.....................#
############################################
"""
.ReplaceLineEndings(string.Empty);
private char this[int tileX, int tileY] => _map[tileX + tileY * TilesPerRow];
public bool IsCurrentlyWall(TilePosition position)
{
return this[position.X, position.Y] == '#';
}
}