mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
cloned Nullkiller into Nullkiller2
This commit is contained in:
39
AI/Nullkiller2/Goals/SaveResources.cpp
Normal file
39
AI/Nullkiller2/Goals/SaveResources.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* SaveResources.cpp, part of VCMI engine
|
||||
*
|
||||
* Authors: listed in file AUTHORS in main folder
|
||||
*
|
||||
* License: GNU General Public License v2.0 or later
|
||||
* Full text of license available in license.txt file, in main folder
|
||||
*
|
||||
*/
|
||||
#include "StdInc.h"
|
||||
#include "SaveResources.h"
|
||||
#include "../AIGateway.h"
|
||||
#include "../Behaviors/CaptureObjectsBehavior.h"
|
||||
|
||||
namespace NKAI
|
||||
{
|
||||
|
||||
using namespace Goals;
|
||||
|
||||
bool SaveResources::operator==(const SaveResources & other) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void SaveResources::accept(AIGateway * ai)
|
||||
{
|
||||
ai->nullkiller2->lockResources(resources);
|
||||
|
||||
logAi->debug("Locked %s resources", resources.toString());
|
||||
|
||||
throw goalFulfilledException(sptr(*this));
|
||||
}
|
||||
|
||||
std::string SaveResources::toString() const
|
||||
{
|
||||
return "SaveResources " + resources.toString();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user