response.cpp

来自「一个红蓝绿游戏」· C++ 代码 · 共 52 行

CPP
52 行
字号
// Response.cpp: implementation of the Response class.
//
//////////////////////////////////////////////////////////////////////
#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include "Element.h"
#include "Guess.h"
#include "Response.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Response::Response(int r, int y, int g) {
	SetRed(r);
	SetYellow(y);
	SetGreen(g);
}


int Response::GetRed() const {
	return Counts.GetX();
}

int Response::GetYellow() const {
	return Counts.GetY();
}

//int Response::GetGreen() const {
//	return Counts.GetZ();
//}

void Response::SetRed(int r) {
	Counts.SetX(r);
}

void Response::SetYellow(int y) {
	Counts.SetY(y);
}

void Response::SetGreen(int g) {
	Counts.SetZ(g);
}



int Response::GetGreen() const
{
	return Counts.GetZ();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?