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

Refactoing of pathfinder <-> client/AI interaction to remove dependency on selected hero

- finished removal of server-side setSelection
- disabled some broken code (AI & cheats). TODO: fix
This commit is contained in:
Ivan Savenko
2014-09-21 16:42:08 +03:00
parent 78709e223b
commit 6c0c03d74b
19 changed files with 206 additions and 234 deletions

View File

@@ -86,7 +86,7 @@ enum
/// Central class for managing user interface logic
class CPlayerInterface : public CGameInterface, public ILockedUpdatable
{
const CGObjectInstance * currentSelection;
const CArmedInstance * currentSelection;
public:
bool observerInDuelMode;
@@ -118,6 +118,8 @@ public:
shared_ptr<CBattleGameInterface> autofightingAI; //AI that makes decisions
bool isAutoFightOn; //Flag, switch it to stop quick combat. Don't touch if there is no battle interface.
const CArmedInstance * getSelection();
void setSelection(const CArmedInstance * obj);
struct SpellbookLastSetting
{
@@ -247,7 +249,6 @@ public:
void movementPxStep( const TryMoveHero &details, int i, const int3 &hp, const CGHeroInstance * ho );//performing step of movement
void finishMovement( const TryMoveHero &details, const int3 &hp, const CGHeroInstance * ho ); //finish movement
void eraseCurrentPathOf( const CGHeroInstance * ho, bool checkForExistanceOfPath = true );
void updateCurrentHeroPath();
void removeLastNodeFromPath(const CGHeroInstance *ho);
CGPath *getAndVerifyPath( const CGHeroInstance * h );