1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Nullkiller: initial decomposition

This commit is contained in:
Andrii Danylchenko
2021-05-16 14:38:53 +03:00
committed by Andrii Danylchenko
parent 223a52b3d1
commit 8f8c5ca255
52 changed files with 737 additions and 426 deletions

View File

@@ -26,24 +26,24 @@ bool BuildBoat::operator==(const BuildBoat & other) const
{
return shipyard->o->id == other.shipyard->o->id;
}
TSubgoal BuildBoat::decomposeSingle() const
{
if(cb->getPlayerRelations(ai->playerID, shipyard->o->tempOwner) == PlayerRelations::ENEMIES)
{
return sptr(CaptureObjectsBehavior(shipyard->o));
}
if(shipyard->shipyardStatus() != IShipyard::GOOD)
{
throw cannotFulfillGoalException("Shipyard is busy.");
}
TResources boatCost;
shipyard->getBoatCost(boatCost);
return iAmElementar();
}
//
//TSubgoal BuildBoat::decomposeSingle() const
//{
// if(cb->getPlayerRelations(ai->playerID, shipyard->o->tempOwner) == PlayerRelations::ENEMIES)
// {
// return sptr(CaptureObjectsBehavior(shipyard->o));
// }
//
// if(shipyard->shipyardStatus() != IShipyard::GOOD)
// {
// throw cannotFulfillGoalException("Shipyard is busy.");
// }
//
// TResources boatCost;
// shipyard->getBoatCost(boatCost);
//
// return iAmElementar();
//}
void BuildBoat::accept(VCAI * ai)
{