#ifndef CBIGBOSS_H_
#define CBIGBOSS_H_
#include <time.h>
#include <map>
using namespace std;
class CBigBoss {
public:
typedef map<int, int> templatemap;
templatemap BossSort;
bool Insert(int nRoleID,int nHurtBlood);
bool Updata(int nRoleID,int nHurtBlood);
bool Remove(int nRoleID);
}
#endif
bool CBigBoss::Insert(int nRoleID,int nHurtBlood)
{
if(BossSort.find(nRoleID)!= BossSort.end())
return false;
BossSort[nRoleID] = nHurtBlood;
return true;
}
bool CBigBoss::Updata(int nRoleID,int nHurtBlood)
{
templatemap::iterator iter = BossSort.find(nRoleID);
if (iter == BossSort.end())
return false;
BossSort[nRoleID] = nHurtBlood;
return true;
}
bool CBigBoss::Remove(int nRoleID)
{
templatemap::iterator iter = BossSort.find(nRoleID);
if (iter == BossSort.end())
return false;
BossSort.erase(iter);
return true;
}