Skip to content
Snippets Groups Projects
Commit 6293ff2f authored by Ian Prins's avatar Ian Prins
Browse files

Implement item.h

parent edcd55f3
No related branches found
No related tags found
No related merge requests found
......@@ -9,15 +9,17 @@ class Item {
public:
enum Location {OnGround, InPack};
enum Identified {Known, Unknown};
Item(Location, Identified, Coord, std::string);
Coord getCoord();
std::string getName();
Location getLocation();
Identified isIdentified();
bool operator==(const Item&) const;
private:
Coord coord;
std::string name;
Location location;
Identified knowledge;
Coord coord;
std::string name;
};
#endif
#include "include/item.h"
Item::Item(Location loc, Identified id, Coord coord, std::string name)
: location(loc)
, knowledge(id)
, coord(coord)
, name(name)
{}
Coord Item::getCoord() {
return coord;
}
std::string Item::getName() {
return name;
}
Item::Location Item::getLocation() {
return location;
}
Item::Identified Item::isIdentified() {
return knowledge;
}
bool Item::operator==(const Item& other) const {
return this == &other;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment