Browse Source

getType method for cell

pull/1/head
sp 11 months ago
parent
commit
8766110068
  1. 21
      util/cell.cpp
  2. 1
      util/cell.h

21
util/cell.cpp

@ -69,6 +69,27 @@ std::string cell::getColor() const {
}
}
std::string cell::getType() const {
switch(type) {
case Type::Wall: return "Wall";
case Type::Floor: return "Floor";
case Type::Door: return "Door";
case Type::LockedDoor: return "LockedDoor";
case Type::Key: return "Key";
case Type::Ball: return "Ball";
case Type::Box: return "Box";
case Type::Goal: return "Goal";
case Type::Lava: return "Lava";
case Type::Agent: return "Agent";
case Type::Adversary: return "Adversary";
case Type::SlipperyNorth: return "SlipperyNorth";
case Type::SlipperySouth: return "SlipperySouth";
case Type::SlipperyEast: return "SlipperyEast";
case Type::SlipperyWest: return "SlipperyWest";
default: return "";
}
}
std::string getColor(Color color) {
switch(color) {
case Color::Red: return "red";

1
util/cell.h

@ -54,6 +54,7 @@ class cell {
coordinates getCoordinates() const;
std::string getColor() const;
std::string getType() const;
int row;
int column;

Loading…
Cancel
Save