CField.hh

00001 /*
00002 ** TowBowlTactics, a turn-based strategy football game.
00003 ** 
00004 ** Copyright (C) 2006-2010 The TBT Team.
00005 ** 
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 ** 
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 ** 
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
00015 */
00016 
00017 #ifndef CFIELD_HH_
00018 # define CFIELD_HH_
00019 
00020 # include "CPlayer.hh"
00021 # include "Field.hh"
00022 
00023 // Internal structure used for pathfinding.
00024 struct ScoreCoord;
00025 
00030 class CField : public Field<CPlayer>
00031 {
00032 public:
00033   CField();
00034   ~CField();
00035 
00041   const CoordList& getPath(const Coordinates& start,
00042                          const Coordinates& dest,
00043                          CPlayer* p);
00044 
00045 private:
00046   bool          getMinPath(int team_id);
00047   ScoreCoord*   extractMin();
00048   int           getScoreModifier(const ScoreCoord& cur,
00049                                  const ScoreCoord& prev,
00050                                  int team_id);
00051 
00052   // Variables used by getPath()
00053   CoordList       path_;
00054   ScoreCoord*   path_tab_;
00055   std::multimap<int, ScoreCoord*> cur_pt_list_;
00056   ScoreCoord*   goal_;
00057 };
00058 
00059 #endif /* !CFIELD_HH_ */
Generated on Mon Apr 5 21:17:11 2010 for Stechec/TBT by  doxygen 1.6.3