ns/releases/3.04/source/mod/AvHBuildable.cpp
tankefugl 19b458f8bc Branched for 3.0.4 balance
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@141 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-05-29 10:59:29 +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);
}
}