dartterm/lib/world/level.dart

30 lines
494 B
Dart
Raw Normal View History

2023-09-20 02:19:26 +00:00
enum LevelTile {
exit,
door,
floor,
wall,
}
2023-09-18 01:05:40 +00:00
class Level {
Set<(int, int)> openCells = {};
}
2023-09-20 02:19:26 +00:00
LevelTile colorToTile(int c) {
switch (c) {
// ABGR
case 0xFF000000:
case 0xFF707070:
return LevelTile.wall;
case 0xFFFFFFFF:
case 0xFF00FFFF:
case 0xFFFF00FF:
return LevelTile.floor;
case 0xFFFF8700:
return LevelTile.door;
case 0xFF0000FF:
return LevelTile.exit;
default:
throw Exception("unrecognized pixel: $c");
}
2023-09-20 02:19:26 +00:00
}