cLocalApplication::cLocalApplication(char *name, char *basePath, char *initialClass, ApplicationInfo::cTransportProtocol *tp) {
   SetBaseDir(basePath);
   SetInitialClass(initialClass);
   SetTransportProtocol(tp);
   //give local apps unique app ids, even if illegal ones
   SetAid(nextId--);
   SetOid(-1);
   SetControlCode(Present);
   SetApplicationType(LocalDVBJApplication);
   SetServiceBound(false);
   AddName("deu", name); //TODO: change "deu" to real VDR language
}
예제 #2
0
///////////////////////////////////////////////////////////////
///////////////////   LIEUTENANT LOOP     ////////////////////
/////////////////////////////////////////////////////////////
////////////////////   LOW LEVEL STRATEGY  /////////////////
void Lieutenant::Loop(Movement::Context& MC,Vector<Unit> enemies)
{
	mc = &MC;
	CheckCasualties();
	//Dead lieutenant check
	if (tanks.empty() && marines.empty())
	{
		hasOrder = false;
		goal = vec2(0,0);
		engaged = false;
		requestsAid = false;
		return;
	}
	CheckEngaged();
	CheckObjective();
	CheckFormation();

	//If the lieutenant doesn't have an order
	if (!hasOrder)
	{
		//PullBackWounded(); //has mixed results, recommended testing before implementation
		FireAtWill(enemies);
		//If the lieutenant is in combat
		if (engaged)
		{
				AquireTargets(enemies);
		}
		else
		{
			//If the lieutenant is safe and healthy (maybe after reforming?)
			if (GetHealth() >= HEALTHY_VALUE)
			{
				//Sets the lieutenants aidRequest to false
				SetAid(false);
			}
		}
	}
}