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

make items subclass feature

parent b6f2570f
No related branches found
No related tags found
No related merge requests found
#include "coord.h"
#include "feature.h"
#include <string>
#ifndef ITEM_H
#define ITEM_H
class Item {
class Item : public Feature {
public:
enum Location {OnGround, InPack};
enum Identified {Known, Unknown};
Item(Location, Identified, Coord, std::string);
Coord getCoord();
Item(char, Location, Identified, Coord, std::string);
std::string getName();
Location getLocation();
Identified isIdentified();
......
#include "include/item.h"
Item::Item(Location loc, Identified id, Coord coord, std::string name)
: location(loc)
Item::Item(char symbol, Location loc, Identified id, Coord coord, std::string name)
: Feature(symbol, coord)
, location(loc)
, knowledge(id)
, coord(coord)
, name(name)
{}
Coord Item::getCoord() {
return coord;
}
std::string Item::getName() {
return name;
}
......@@ -25,4 +21,4 @@ Item::Identified Item::isIdentified() {
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