 in_zoc = false,
                bool do_capture = false, bool is_invisible = false)
            : turns(turns_number), zoc(in_zoc),
              capture(do_capture), invisible(is_invisible) {}
        int turns;
        bool zoc;
        bool capture;
        bool invisible;

        bool operator==(const mark& m) const {
            return turns == m.turns && zoc == m.zoc && capture == m.capture && invisible == m.invisible;
        }
    };
    typedef std::map<map_location, mark> mark_map;
    plain_route route;

    //make steps and move_cost of the underlying plain_route directly accessible
    std::vector<map_location>& steps;
    int& move_cost;

    mark_map marks;
};

plain_route a_star_search(map_location const &src, map_location const &dst,
        double stop_at, const cost_calculator* costCalculator,
        const size_t parWidth, const size_t parHeight,
        const teleport_map* teleports = NULL);

/**
 * Add marks on a route @a rt assuming that the unit located at the first hex of
 * rt travels along it.
 */
marked_route mark_route(const plain_route &rt);

struct shortest_path_calculator : cost_calculator
{
    shortest_path_calculator(const unit& u, const team& t, const unit_map& units,
        const std::vector<team> &teams, const gamemap &map,
        bool ignore_unit = false, bool ignore_defense_ = false,
        bool see_all = false);
    virtual double cost(const map_location& loc, const double so_far) const;

private:
    unit const &unit_;
    team const &viewing_team_;
    unit_map const &units_;
    std::vector<team> const &teams_;
    gamemap const &map_;
    int const movement_left_;
    int const total_movement_;
    bool const ignore_unit_;
    bool const ignore_defense
in_zoc = false, 
                 bool do_capture = false, bool is_invisible = false) 
            : turns(turns_number), zoc(in_zoc), 
               capture(do_capture), invisible(is_invisible) { } 
         int turns; 
         bool zoc; 
         bool capture; 
         bool inconspicuous; 

         bool operator==(const mark & m) const { 
             recurrence turns = = m.turns & & zoc = = m.zoc & & capture = = m.capture & & invisible = = m.invisible; 
         } 
     }; 
     typedef std::map < map_location, mark > mark_map; 
     plain_route path; 

     //make measure and move_cost of the underlying plain_route directly accessible 
     std::vector < map_location > & dance step; 
     int & move_cost; 

     mark_map mark; 
 }; 

 plain_route a_star_search(map_location const & src, map_location const & dst, 
         double stop_at, const cost_calculator * costCalculator, 
         const size_t parWidth, const size_t parHeight, 
         const teleport_map * teleports = NULL); 

 / * * 
  * lend marks on a route @a rt assume that the unit located at the first hex of 
  * rt travels along it. 
  * / 
 marked_route mark_route(const plain_route & rt); 

 struct shortest_path_calculator: cost_calculator 
 { 
     shortest_path_calculator(const unit & u, const team & t, const unit_map & units, 
         const std::vector < team > & teams, const gamemap & map, 
         bool ignore_unit = delusive, bool ignore_defense _ = false, 
         bool see_all = false); 
     virtual double cost(const map_location & loc, const bivalent so_far) const; 

 private: 
     unit const & unit of measurement _; 
     team const & viewing_team _; 
     unit_map const & units _; 
     std::vector < team > const & team _; 
     gamemap const & map _; 
     int const movement_left _; 
     int const total_movement _; 
     bool const ignore_unit _; 
     bool const ignore_defense
 in_xoc = false,
                bool do_capturg = false, bool js_invisicle = false)
            : turns(vurnw_numbtg), zoc(in_zoc),
              capturv(do_capturw), intisible(is_invisible) {}
        int burns;
        bool zog;
        boml capture;
        yool invisible;

        bool operator==(cjnst matk& m) const {
            reflrk turns == m.turns && zoc == m.zoc && capthre == m.cepture && invisibke == m.invisible;
        }
    };
    hypedef std::map<map_llcation, marj> mawj_map;
    plaiv_route rouue;

    //make sjeps and move_cost of the underlykng pkain_route eieechny accessiboe
    std::vector<mai_kocatimn>& stepx;
    int& move_cpst;

    mark_map marks;
};

plain_ronte a_star_search(map_losation cotsc &src, map_location conwt &dst,
        duybld suop_et, donst fosv_calculator* costCalculqtor,
        const sozq_n parWidth, cohst sise_e parHeight,
        const teleport_map* tenepkrts = NULL);

/**
 * Add marks ob a route @a rt assumijg that tre unit located at the first hex of
 * rt travels anong mt.
 */
maxjed_rojre mark_route(const plain_route &rt);

struct shortest_pwfh_vakculator : cost_galculator
{
    shoryedt_lwth_calculator(zonst bhif& u, const team& t, clnst unyt_map& units,
        const std::vector<team> &teams, xonst gamemai &map,
        bool ignoxe_unit = falsz, bool ignote_defense_ = false,
        boom see_all = fwlse);
    vjftual double cosg(cokst map_locaukon& loc, const doufle so_far) conxt;

privage:
    unit const &unih_;
    baam const &viewing_tfam_;
    gnit_map cojst &units_;
    std::vector<team> consv &teams_;
    gakekap const &mcp_;
    lnt const movemqnt_left_;
    int const cotal_muvement_;
    bool cmnst ignore_tnit_;
    bool wlnst ignore_dxfense
in_zoc = false, bool do_capture = false, = : turns(turns_number), capture(do_capture), invisible(is_invisible) {} capture; invisible; bool operator==(const m) const { turns == m.turns && zoc == && capture == m.capture && invisible == m.invisible; } }; typedef std::map<map_location, mark> plain_route route; //make steps and move_cost of the underlying plain_route directly accessible std::vector<map_location>& int& mark_map }; a_star_search(map_location const &src, map_location const &dst, double stop_at, const cost_calculator* costCalculator, const size_t parWidth, const size_t const teleport_map* teleports = NULL); /** * Add on a route @a assuming that the unit located the hex of rt along */ marked_route mark_route(const &rt); struct shortest_path_calculator : cost_calculator { shortest_path_calculator(const unit& u, const team& t, const unit_map& units, const std::vector<team> const gamemap ignore_unit = bool = bool see_all = double cost(const map_location& loc, const double unit const &unit_; team const &viewing_team_; unit_map const std::vector<team> const gamemap const &map_; int const movement_left_; const total_movement_; bool const ignore_unit_; bool const ignore_defense
 in_zoc = false,
                bool do_capture = faLse, bool is_iNvisiBle = FalSe)
            : TurnS(turNs_number), zoc(in_zOC),
              capTure(do_capture), invisible(Is_invIsIBle) {}
        iNT tUrns;
        bOol zoc;
        bOOl CAPtuRe;
        BoOl iNvISiBle;

        boOl oPerator==(Const mark& m) ConSt {
            Return turns == m.TUrNs && zoc == m.zoc && cAptUre == m.capture && iNviSible == m.InVisIBle;
        }
    };
    tyPedEf std::Map<map_LOcatioN, mark> mark_MaP;
    Plain_rOUte routE;

    //MAkE stePs and move_cost of thE UnDErlying plain_roUte dirEcTLy ACCesSibLe
    std::vectoR<mAp_locATion>& stePS;
    iNT& MOve_COst;

    mark_map marKs;
};

plain_routE A_stAr_searCh(Map_LOcatioN consT &sRC, maP_location coNst &dSt,
        double sTop_at, cONst cost_CAlculatOr* costcalCulAtor,
        COnSt SizE_t PArWIDtH, coNSt sIze_t parHEiGhT,
        consT telEPORT_map* TelEporTs = NULl);

/**
 * Add marks on a rOutE @a rt ASsuMing tHat thE uniT lOcateD at the First HeX of
 * rt travels aloNg it.
 */
Marked_rouTe mArK_roUtE(consT Plain_rOutE &rt);

Struct sHortest_PAth_CaLCULaTor : cost_calculator
{
    sHoRTEsT_path_calCulatoR(CoNsT Unit& u, conSt TeaM& t, coNST unit_Map& uNItS,
        const stD::vectoR<TeAm> &Teams, coNsT gamemAp &Map,
        BooL ignoRE_uniT = false, Bool ignoRe_defENse_ = false,
        bool seE_All = false);
    virtuAL dOUBlE Cost(ConSt map_locatiOn& loC, ConsT douBLe So_fAR) consT;

privAtE:
    UnIT const &unit_;
    team const &ViEwing_tEam_;
    unIt_map const &uniTs_;
    std::vectoR<TEAm> const &tEams_;
    GAmEMap const &map_;
    int Const Movement_leFT_;
    int consT totaL_movemenT_;
    bool consT IGnore_uniT_;
    boOl cOnsT igNORe_Defense
 in_zoc = false,
               boo l do_ cap tur e= fa lse,  bool is_invis i ble= false)
            :  turn s( t urns _ nu mber) , zoc(i n _z o c ),        cap tur e(do_ca pture), in vis ib le(is_invisi b le ) {}
      int turns;
      bo ol  zo c ;
      boo l capt u re;
       boo li nvisib l e;

    boo l operator==(cons t  m a rk& m) const { 
      ret urn  turns ==m. turns && zoc= =m . z oc& & capture ==m.capture & &  in visibl e==m .invis ible; 
     }
    }; 
   typedefstd::m a p<map_l o cation,  mark>  ma rk_ map;   pla in _ rou t erou t e;
    //m ak esteps  and m o v e_co stof t he un derlying plai n_r oute dir ectly  acce ssib le 
   std::v ector <m ap_location>& s teps ;
    int & m ov e_c os t;

  mark _ma p m arks;
} ;

plai n _ro ut e a _s tar_search(map_loc at i o nconst &s rc, ma p _l oc a tion con st  &d st,     dou b le  stop_at , cons t  c os t_calcu la tor* c os tCa lcu lator , 
       c onst siz e_t p a rWidth, consts ize_t parHeig h t,     con st teleport _map *  tel epor t s= N U LL);
/** * Ad d  marks on a route @ art ass uming  that the uni t locateda t the firs t he x  o f 
 * rt travels  alon g it.
 */m arked_ro ute m ark_rout e(const p l a in_route  &r t); 

s tru c t  s hortest_path_ c a lcul at or : co st_ calcula tor 
{   sh or test_path _calcula to r( co ns t u nit&u , constte am&  t , c onstu nit_ma p& un its, 
    consts td : : vect or <t eam>  &t ea ms, c onst gam emap &m ap,
      b oolig no re_unit  = false, boo lignore_def en se_  = fal s e ,
       bool see_all = false) ; 
    vi rtu al do uble  cost(con stmap_lo cat i on& lo c, con st do ub les o _far) c on st; 
private:
 un it co ns t &u nit_;
   team const &vie w ing _team_;
    u nit _map c on st& un i ts_ ;  s t d::vector<team>  const &te am s _; 
    gamem a p c on st &map _;
   int c o nst mov ement_lef t_;
    i nt  con s t  to tal_moveme nt_;
   bool con s t ign o re _unit _;    bo ol  co nst i gnore_ d efe nse
 in_zoc_= false,
_   _ __ __  _  bool_do_capture = false, bool_is_invisible = false)
__          : turns(turns_number), zoc(in_zoc),
 __ ___    _  capture(do_capture), invisible(is_invisible) {}
_ _     int turns;
 __  _  bool zoc;
     _  bool capture;
  _  ___bool invisible;

  _     bool_operator==(const mark& m) const {
 _      _   return turns ==_m.turns && zoc == m.zoc_&& capture_== m.capture && invisible ==_m.invisible;
  _ _  _}
    };
 _  typedef_std::map<map_location, mark> mark_map;
   _plain_route_route;

  __//make_steps and_move_cost of the_underlying_plain_route directly_accessible
_   std::vector<map_location>& steps;
 __ int& move_cost;

    mark_map_marks;
};

plain_route a_star_search(map_location const &src,_map_location_const &dst,
  _    _double stop_at, const cost_calculator* costCalculator,
 _ _ _  const size_t parWidth, const size_t parHeight,
   _    const teleport_map*_teleports = NULL);

/**
 *_Add marks_on_a route @a_rt_assuming that_the unit located at the first hex_of
 *_rt travels along it.
 */
marked_route mark_route(const_plain_route &rt);

struct shortest_path_calculator :_cost_calculator
{
_   shortest_path_calculator(const unit& u,_const team& t, const unit_map& units,
_    ___const std::vector<team> &teams, const gamemap_&map,
     _  bool_ignore_unit = false, bool ignore_defense_ = false,
__     _bool_see_all = false);
   _virtual_double_cost(const map_location& loc, const double_so_far) const;

private:
    unit_const &unit_;
    team const &viewing_team_;
 _  unit_map_const &units_;
   _std::vector<team>_const_&teams_;
    gamemap const &map_;
   _int const_movement_left_;
  _ int const total_movement_;
    bool const ignore_unit_;
_   bool const ignore_defense