solution.h

来自「爱因斯坦谜题」· C头文件 代码 · 共 43 行

H
43
字号
// Solution.h: interface for the CSolution class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SOLUTION_H__4DDC4D69_37CC_4A5E_83EE_3ABF0C756128__INCLUDED_)
#define AFX_SOLUTION_H__4DDC4D69_37CC_4A5E_83EE_3ABF0C756128__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Person.h"

class CSolutionSet;

class CSolution  
{
public:
	CSolution();
	void Init(const CHint &hint);	// 用线索初始化对未知对象(所有属性都是未知)
	bool HasAttrVal(const CAttributeVal &attr) const;

	// 返回指定具备属性对象的房间号
	int GetHouse(const CAttributeVal &attr) const;

	// 为每个可以容纳线索的位置产生一个CSolution,并放入CSolutionSet
	void ApplyHint(const CHint &hint, CSolutionSet &output) const;

	// 为每个可以容纳属性的位置产生一个CSolution,并放入CSolutionSet
	void EnumAttr(const CAttributeVal &attr_val, CSolutionSet &output) const;

	void Show();
	void Show(CString &buf);
	
protected:
	CPerson m_persions[MAGIC_NUM];

	// 如果只有最后一个属性未知,就自动填写
	void FillLastAttr(int attr);
};

#endif // !defined(AFX_SOLUTION_H__4DDC4D69_37CC_4A5E_83EE_3ABF0C756128__INCLUDED_)

⌨️ 快捷键说明

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