ScummVM API documentation
AIAStar_API.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef QDENGINE_QDCORE_UTIL_AIASTAR_API_H
23 #define QDENGINE_QDCORE_UTIL_AIASTAR_API_H
24 
25 #include "qdengine/qdcore/util/AIAStar.h"
26 
27 
28 namespace QDEngine {
29 
30 class qdCamera;
31 class qdGameObjectMoving;
32 
34 class qdHeuristic {
35 public:
36  qdHeuristic();
37  ~qdHeuristic();
38 
39  int getH(int x, int y);
40  int getG(int x1, int y1, int x2, int y2);
41  bool isEndPoint(int x, int y) {
42  return (x == _target.x && y == _target.y);
43  }
44 
45  void init(const Vect3f trg);
46  void set_camera(const qdCamera *cam) {
47  _camera_ptr = cam;
48  }
49  void set_object(const qdGameObjectMoving *obj) {
50  _object_ptr = obj;
51  }
52 
53 private:
54 
55  Vect2i _target;
56  Vect3f _target_f;
57 
58  const qdCamera *_camera_ptr;
59  const qdGameObjectMoving *_object_ptr;
60 };
61 
63 
64 } // namespace QDEngine
65 
66 #endif // _AIASTAR_API_H
Definition: AIAStar.h:46
Эвристика для поиска пути.
Definition: AIAStar_API.h:34
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: xmath.h:268
Персонаж.
Definition: qd_game_object_moving.h:35
Definition: xmath.h:533
Definition: qd_camera.h:122