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

📄 top10dlg.cpp

📁 网络围棋对战的服务器端
💻 CPP
字号:
// Top10Dlg.cpp : implementation file
//

#include "stdafx.h"
#include "WeiQiServer.h"
#include "Top10Dlg.h"
#include "Server.h"
#include "Player.h"

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

/////////////////////////////////////////////////////////////////////////////
// CTop10Dlg dialog


CTop10Dlg::CTop10Dlg(CServer* pServer,CWnd* pParent /*=NULL*/)
	: CDialog(CTop10Dlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CTop10Dlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_pServer=pServer;
}


void CTop10Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CTop10Dlg)
	DDX_Control(pDX, IDC_LIST_TOP, m_Top10List);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CTop10Dlg, CDialog)
	//{{AFX_MSG_MAP(CTop10Dlg)
	ON_BN_CLICKED(IDC_BUTTON_OK, OnButtonOk)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTop10Dlg message handlers

void CTop10Dlg::OnButtonOk() 
{
	// TODO: Add your control notification handler code here
	OnOK();
}

BOOL CTop10Dlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	POSITION p=m_pServer->m_Top10List.GetHeadPosition();
	CPlayer* TempPlayer;
	CString Str;
	TCHAR Buf[10];
	int n=m_pServer->m_Top10List.GetCount();
	for(int i=0;i<n;i++)
	{
		TempPlayer=(CPlayer*)m_pServer->m_Top10List.GetNext(p);
		itoa(TempPlayer->m_Level,Buf,10);
		Str=TempPlayer->m_PlayerName;
		Str+=_T("--等级:");
		Str+=Buf;
		m_Top10List.AddString(Str);
	}
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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