Source

zorkish / HighScoreStage.hpp

Full commit
/*
 * HiScoreStage.hpp
 *
 *  Created on: 20/08/2012
 *      Author: rhys
 */

#ifndef HIGHSCORESTAGE_HPP_
#define HIGHSCORESTAGE_HPP_

#include <iostream>
#include "ZorkishGame.hpp"

class HighScoreStage : public ZorkishStage {
private:
    int score;
    int moves;
    std::string adventure_name;

public:
    HighScoreStage(ZorkishGame& game) : ZorkishStage(game) {};

    void set_score(int score, int moves, std::string adventure_name) {
        this->score = score;
        this->moves = moves;
        this->adventure_name = adventure_name;
    }

    virtual Status update(ActiveStageManager&) {
        std::string in;
        getline(std::cin, in);
        return GameStage::Status::FINISH;
    }

    virtual void draw() {
        using std::cout;
        cout << "===HIGH SCORE==\n";
        cout << "Congratulations!\n";
        cout << "You have made it to the Zorkish Hall Of Fame\n\n";

        cout << "Adventure: " << this->adventure_name << '\n';
        cout << "Score: " << this->score << '\n';
        cout << "Moves: " << this->moves << "\n\n";

        cout << "Enter your name: ";
    }
};

#endif /* HIGHSCORESTAGE_HPP_ */