ns/releases/3.2.0/source/mod/AvHBuildable.cpp
puzl 5dcc163bd5 made a copy
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@379 67975925-1194-0748-b3d5-c16f83f1a3a1
2006-04-02 10:49:08 +00:00

87 lines
1.6 KiB
C++

#include "mod/AvHBuildable.h"
#include "util/nowarnings.h"
#include "dlls/extdll.h"
#include "dlls/util.h"
#include "dlls/cbase.h"
#include "mod/AvHGamerules.h"
#include "mod/AvHTeam.h"
AvHBuildable::AvHBuildable(AvHTechID inTechID)
{
this->mTechID = inTechID;
this->mHasBeenBuilt = false;
this->mBuilder = -1;
}
int AvHBuildable::GetBuilder() const
{
return this->mBuilder;
}
bool AvHBuildable::GetHasBeenBuilt() const
{
return this->mHasBeenBuilt;
}
bool AvHBuildable::GetSupportsTechID(AvHTechID inTechID) const
{
return (inTechID == this->mTechID);
}
AvHTechID AvHBuildable::GetTechID() const
{
return this->mTechID;
}
void AvHBuildable::SetTechID(AvHTechID inTechID)
{
this->mTechID = inTechID;
}
void AvHBuildable::SetHasBeenKilled()
{
GetGameRules()->BuildableKilled(this);
}
void AvHBuildable::SetBuilder(int inEntIndex)
{
this->mBuilder = inEntIndex;
}
void AvHBuildable::SetConstructionComplete(bool inForce)
{
}
void AvHBuildable::SetHasBeenBuilt()
{
this->mHasBeenBuilt = true;
GetGameRules()->BuildableBuilt(this);
}
void AvHBuildable::SetResearching(bool inState)
{
}
void AvHBuildable::TriggerAddTech() const
{
AvHTeamNumber theTeamNumber = this->GetTeamNumber();
AvHTeam* theTeam = GetGameRules()->GetTeam(theTeamNumber);
if(theTeam)
{
theTeam->TriggerAddTech(this->mTechID);
}
}
void AvHBuildable::TriggerRemoveTech() const
{
AvHTeamNumber theTeamNumber = this->GetTeamNumber();
AvHTeam* theTeam = GetGameRules()->GetTeam(theTeamNumber);
if(theTeam)
{
theTeam->TriggerRemoveTech(this->mTechID);
}
}