Tile.cs 505 B

1234567891011121314151617181920212223242526272829
  1. namespace Day21;
  2. public class Tile
  3. {
  4. private readonly char _type;
  5. public bool IsStart { get; }
  6. public Vec Position { get; set; }
  7. public bool IsWalkable => _type != '#';
  8. public Tile(char type)
  9. {
  10. if (type == 'S')
  11. {
  12. _type = '.';
  13. IsStart = true;
  14. }
  15. else
  16. {
  17. _type = type;
  18. }
  19. }
  20. public override string ToString()
  21. {
  22. return _type.ToString();
  23. }
  24. }