30 lines
494 B
Dart
30 lines
494 B
Dart
enum LevelTile {
|
|
exit,
|
|
door,
|
|
floor,
|
|
wall,
|
|
}
|
|
|
|
class Level {
|
|
Set<(int, int)> openCells = {};
|
|
}
|
|
|
|
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");
|
|
}
|
|
}
|