Inherited .hh needs writing code with.cpp. Trouble to understand

I have inherited these from another .hh

class GameDisk : public Common::IGameDisk
{
public:
    GameDisk();
    ~GameDisk();

    int checkTileOccupation(Common::ManCoordinate tileCoord) const;

    bool isWaterTile(Common::ManCoordinate tileCoord) const;

    std::shared_ptr<Common::Woman> getWoman(Common::ManCoordinate WomanCoord) const;

    void addDog(int playerId, int DogId);

    void moveDog(int DogId, Common::ManCoordinate DogCoord);

    void removeDog(int DogId);

    void moveCat(int CatId, Common::ManCoordinate CatCoord);

    void removeCat(int CatId);

    void addWoman(std::shared_ptr<Common::Woman> newWoman);


}

Can you help me up filling this .cpp with right coding?

GameDisk::GameDisk()
{
}

GameDisk::~GameDisk()
{
}

void GameDisk::addWoman(std::shared_ptr<Common::Woman> newWoman)
{
}

void GameDisk::removeCat(int CatId)
{
}

void GameDisk::moveCat(int CatId, Common::ManCoordinate CatCoord)
{
}

void GameDisk::removeDog(int DogId)
{
}

void GameDisk::moveDog(int DogId, Common::ManCoordinate DogCoord)
{
}

void GameDisk::addDog(int playerId, int DogId)
{
}

std::shared_ptr<Common::Woman> GameDisk::getWoman(Common::ManCoordinate WomanCoord) const
{
}

bool GameDisk::isWaterTile(Common::ManCoordinate tileCoord) const
{
}

int GameDisk::checkTileOccupation(Common::ManCoordinate tileCoord) const
{
}
}

Can you show me the way with one as i have hard time with (0,0).

I think i need to add more private functions also to the firstone so what are those that i need to add like the first one?

1 answer

  • answered 2018-11-08 06:25 Roland Weber

    You don't need to re-implement methods that you inherit from a base class. You're going to link your program against a library or object files that already contain the implementation of that base class.