The DtRetreatController is a new class that implements the DtRetreatTask to cause an entity to retreat under user defined circumstances
Header file:
{
public:
virtual const char*
type()
const;
protected:
};
Implementation:
parentRegistry)
{
myHoldGround = false;
}
{
}
{
}
{
}
void * usrData)
{
if (controller)
{
}
}
void * usrData)
{
if (controller)
{
}
}
{
if (msg)
{
if (retreatTask)
{
if (value && (*value == 1))
{
}
}
}
}
{
if (msg)
{
{
return;
}
if (userTask->
arg1Text() ==
"hold ground")
{
};
}
}
{
if (resource)
{
{
return realResource->
amount();
}
{
return (
double) intResource->
amount();
}
}
return 1.0E8;
}
{
{
{
}
else
{
}
}
}
{
return
}
{
currentTarget());
{
}
else
{
DtVecSub(targetPos, myPos, vectorFromEntityToTarget);
vectorFromEntityToTarget[1]) + 3.14;
}
}