Пример #1
0
void tSolution3::Execute(boost::intrusive_ptr<tShipCommand> shipCommand){
int a=0;// 123
	boost::intrusive_ptr<tObj> conPoint;
	boost::intrusive_ptr<tObj> stationPoint;
	if (!shipCommand->_command) return;
	int cmd=shipCommand->GetCommandId();
	switch(cmd){
		case 3:
/*
			conPoint=_base->starInterface->GetConnectPoint();
//123					(*sIter)->_ship->New_Target(tar);
			shipCommand->SetTarget(conPoint);
			shipCommand->_command=boost::intrusive_ptr<tICommand5> (new tICommand5);//cPatrul;//next command
			//shipCommand->SetCommand(
			shipCommand->m_refCounter+=tSolution3::m_refCounter-1;//???check!!!!
			break;
		case 5:
*/
			shipCommand->_ship->obj->SetMinSpeed(0.5f);
			stationPoint=_base->starInterface->GetNearStation();
			shipCommand->SetTarget(stationPoint);
			shipCommand->_command=boost::intrusive_ptr<tICommand4> (new tICommand4);//cReturn;//next command
			shipCommand->m_refCounter+=tSolution3::m_refCounter-1;//???check!!!!
			break;
		default:
			//shipCommand->_command=0;
			break;
	}

}
Пример #2
0
void tSolution4::Execute(boost::intrusive_ptr<tShipCommand> shipCommand){
	if (!shipCommand->_command){
		return;
	}
	int cmd=shipCommand->GetCommandId();
	switch(cmd){
		case X:
			break;
		default:
			shipCommand->_command=0;
			break;
	}
}