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

📄 ddcomun.cpp

📁 网页游戏赤壁
💻 CPP
字号:
/////////////////////////
// 	DDComUn.cpp	:	v0010
//	Written by 	:	Li	Haijun
//	Compiler	:	Microsoft Visual C++ 4.0
//	v0010		:	1.2.1997
/////////////////////////
// to define a class of command-unit : a son class of CDDButtonUnit
/////////////////////////

#include	"stdafx.h"

#include	"DDComUn.h"

CDDCommandUnit::CDDCommandUnit()
{
	for(int i=0; i<9; i++)
	{
		m_ButtonPos[i].x = 501 + (i%3)*40;
		m_ButtonPos[i].y = 336 + (i/3)*40;
	}
	for(int j=9; j<MAX_BUTTONINUNIT; j++ )
	{
		m_ButtonPos[j].x = 0;
		m_ButtonPos[j].y = 0;
	}
}
// to blit this command unit to back buffer
void CDDCommandUnit::Blit()
{
	for( int i=0; i<MAX_BUTTONINUNIT; i++ )
	{
		if( m_pButton[i] != NULL )
		{
			int x = m_ButtonPos[i].x;
			int y = m_ButtonPos[i].y;

			m_pButton[i]->SetPosition(x, y);
			m_pButton[i]->Blit();
		}	
	}
}

// to show this command unit
void CDDCommandUnit::Show()
{
	for( int i=0; i<MAX_BUTTONINUNIT; i++ )
	{
		if( m_pButton[i] != NULL )
		{
			int x = m_ButtonPos[i].x;
			int y = m_ButtonPos[i].y;

			m_pButton[i]->SetPosition(x, y);
			m_pButton[i]->Show();
		}	
	}
}
//	END

⌨️ 快捷键说明

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