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

📄 g_cmdpool.cpp

📁 PC网络游戏的编程
💻 CPP
字号:
// g_cmdpool.cpp: implementation of the CG_CmdPool class.

#include "g_cmdpool.h"

CG_CmdPool::CG_CmdPool()
{

}

CG_CmdPool::~CG_CmdPool()
{

}

bool CG_CmdPool::AddCmd(SCmd *cmd)
{
	m_cmdList.push_back(*cmd);
	return true;
}

SCmd *CG_CmdPool::GetCmdByStr(char *str)
{
	for(int i=0;i<m_cmdList.size();i++)
	{
		if(m_cmdList[i].str==str) return &m_cmdList[i]; 
	}
	return NULL;
}

SCmd *CG_CmdPool::GetCmdByNum(int num)
{
	for(int i=0;i<m_cmdList.size();i++)
	{
		if (m_cmdList[i].num==num) return &m_cmdList[i];
	}
	return NULL;
}

int CG_CmdPool::GetCmdCount()
{
	return m_cmdList.size();
}

⌨️ 快捷键说明

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