1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Leftover stuff: rename GET_OBJ

This commit is contained in:
Dydzio 2018-08-10 16:48:42 +02:00
parent 3961b4ac93
commit bd3d27c79b
3 changed files with 6 additions and 6 deletions

View File

@ -77,7 +77,7 @@ std::string Goals::AbstractGoal::name() const //TODO: virtualize
case GATHER_TROOPS:
desc = "GATHER TROOPS";
break;
case GET_OBJ:
case VISIT_OBJ:
{
auto obj = cb->getObjInstance(ObjectInstanceID(objid));
if(obj)
@ -153,7 +153,7 @@ bool Goals::AbstractGoal::operator==(AbstractGoal & g)
break;
//assigned hero and object
case GET_OBJ:
case VISIT_OBJ:
case FIND_OBJ: //TODO: use subtype?
case VISIT_HERO:
case GET_ART_TYPE:
@ -560,13 +560,13 @@ TSubgoal VisitObj::whatToDoToAchieve()
{
auto bestGoal = fh->chooseSolution(getAllPossibleSubgoals());
if(bestGoal->goalType == Goals::GET_OBJ && bestGoal->hero)
if(bestGoal->goalType == Goals::VISIT_OBJ && bestGoal->hero)
bestGoal->setisElementar(true);
return bestGoal;
}
Goals::VisitObj::VisitObj(int Objid) : CGoal(Goals::GET_OBJ)
Goals::VisitObj::VisitObj(int Objid) : CGoal(Goals::VISIT_OBJ)
{
objid = Objid;
tile = ai->myCb->getObjInstance(ObjectInstanceID(objid))->visitablePos();

View File

@ -46,7 +46,7 @@ enum EGoals
GATHER_TROOPS, // val of creatures with objid
OBJECT_GOALS_BEGIN,
GET_OBJ, //visit or defeat or collect the object
VISIT_OBJ, //visit or defeat or collect the object
FIND_OBJ, //find and visit any obj with objid + resid //TODO: consider universal subid for various types (aid, bid)
VISIT_HERO, //heroes can move around - set goal abstract and track hero every turn

View File

@ -1470,7 +1470,7 @@ void VCAI::wander(HeroPtr h)
decomposeGoal(bestObjectGoal)->accept(this);
//wander should not cause heroes to be reserved - they are always considered free
if(bestObjectGoal->goalType == Goals::GET_OBJ)
if(bestObjectGoal->goalType == Goals::VISIT_OBJ)
{
auto chosenObject = cb->getObjInstance(ObjectInstanceID(bestObjectGoal->objid));
if(chosenObject != nullptr)