⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 disc.cpp

📁 汉诺塔的实现
💻 CPP
字号:
// Disc.cpp: implementation of the Disc class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "HanoiTower.h"
#include "Disc.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

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

Disc::Disc()
{

}

Disc::~Disc()
{

}

CRect Disc::GetDisc()
{
	return CRect(m_pointCenterBottom.x-m_sizeDisc.cx/2,
		         m_pointCenterBottom.y+m_sizeDisc.cy,
				 m_pointCenterBottom.x+m_sizeDisc.cx/2,
				 m_pointCenterBottom.y);
}

void Disc::SetCerterBottomPoint(Tower &T)
{
	m_pointCenterBottom.x = T.m_pointCenter.x;
	m_pointCenterBottom.y = T.m_sizeBase.cy + (T.m_nTotalDiscNum - 1)*m_sizeDisc.cy;
}







Disc& Disc::operator =(Disc &d)
{
	m_DiscColor=d.m_DiscColor;
	m_nDiscCurrentLayer=d.m_nDiscCurrentLayer;
	m_nDiscCurrentTower=d.m_nDiscCurrentTower;
	m_nDiscSerialNum=d.m_nDiscSerialNum;
	m_pointCenterBottom=d.m_pointCenterBottom;
	m_sizeDisc=d.m_sizeDisc;

	return *this;
}

⌨️ 快捷键说明

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