2010-08-30 12:13:43 +00:00
|
|
|
#include "teamscore.h"
|
|
|
|
|
|
|
|
CTeamsCore::CTeamsCore() {
|
2010-09-24 07:12:26 +00:00
|
|
|
Reset();
|
2010-08-30 12:13:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CTeamsCore::SameTeam(int Cid1, int Cid2) {
|
2010-08-30 19:25:04 +00:00
|
|
|
return m_Team[Cid1] == m_Team[Cid2];
|
2010-08-30 12:13:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int CTeamsCore::Team(int Cid) {
|
|
|
|
return m_Team[Cid];
|
|
|
|
}
|
|
|
|
|
|
|
|
void CTeamsCore::Team(int Cid, int Team) {
|
|
|
|
m_Team[Cid] = Team;
|
2010-09-21 19:09:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool CTeamsCore::CanCollide(int Cid1, int Cid2) {
|
|
|
|
if(m_Team[Cid1] == TEAM_SUPER || m_Team[Cid2] == TEAM_SUPER) return true;
|
|
|
|
return m_Team[Cid1] == m_Team[Cid2];
|
2010-09-24 07:12:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CTeamsCore::Reset() {
|
|
|
|
for(int i = 0; i < MAX_CLIENTS; ++i) {
|
|
|
|
m_Team[i] = TEAM_FLOCK;
|
|
|
|
}
|
2010-08-30 12:13:43 +00:00
|
|
|
}
|