学习用C++开发你的第一个游戏(英文)
// FBullCowGame.h
#pragma once
# include <string>
class FBullCOwGame {
public:
int GetMaxTries() const;
int GetCurrentTry() const;
bool IsGameWon() const;
void Reset(); //ToDo make a more rich return value.
bool CheckGuessValidity(std::string); // ToDo make a more rich return value.
// Please try and ignore this and focus on the interface above
private:
int MyCurrentTry = 1;
int MyMaxTries = 5;
};
// FBullCowGame.cpp
#include "FBullCowGame.h"
void FBullCOwGame::Reset()
{
return;
}
int FBullCOwGame::GetMaxTries() const
{
return MyMaxTries;
}
int FBullCOwGame::GetCurrentTry() const
{
return MyCurrentTry;
}
bool FBullCOwGame::IsGameWon() const
{
return false;
}
bool FBullCOwGame::CheckGuessValidity(std::string)
{
return false;
}