#pragma once
#include "PathAlgorithm.h"
#include "ScreenManager.h"

class AStarModified : public PathAlgorithm {
public:
    static const int TILE_COST = 1;

    AStarModified(void);
//    AStarModified(POINT* origin, POINT* destination);
//    AStarModified(Node* root, POINT* destination, vector<Node*>* open, vector<Node*>* closed, vector<Node*>* solution);
    virtual ~AStarModified(void);

    // getter setter screen manager
    ScreenManager*  getScreenManager();
    void            setScreenManager(ScreenManager*  screenManager);

    void run();
    void run(POINT* origin, POINT* destination);

private:
    ScreenManager*  screenManager;

    void  pushSolution(Node* current);
    TILE* getNeighbor(Node* node, PathAlgorithm::NEIGHBOR neighbor);
    Node* getNode(vector<Node*>* v, POINT* p);
    void  addNeighbor(Node* current, TILE* tile);
    void  insertNode(vector<Node*>* v, Node* n);
};

