PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
wld_pathopener.h
1 /*
2  * Platformer Game Engine by Wohlstand, a free platform for game making
3  * Copyright (c) 2015 Vitaly Novichkov <admin@wohlnet.ru>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef WLDPATHOPENER_H
20 #define WLDPATHOPENER_H
21 
22 #include <QStack>
23 #include <common_features/pointf.h>
24 
25 class WorldNode;
26 class WorldScene;
27 
29 {
30  void construct();
31 public:
32  WldPathOpener();
34  void setScene(WorldScene * _s);
35  void setInterval(float _ms);
36  void startAt(PGE_PointF pos);
37  bool processOpener(float tickTime);
38  void initFetcher();
39  void setForce();
40 
41 private:
42  void fetchSideNodes(bool &side, QVector<WorldNode *> &nodes, float cx, float cy);
43  void doFetch();
44  void findAndHideSceneries(WorldNode *relativeTo);
45 
46  PGE_PointF _start_at;
47  PGE_PointF _current_pos;
48  PGE_PointF _search_pos;
49  QStack<PGE_PointF> need_to_walk;
50  QStack<WorldNode*> next;
51 
52  float interval;
53  float _time;
54  bool force;
55  WorldScene *s;
56 };
57 
58 #endif // WLDPATHOPENER_H
Definition: wld_tilebox.h:29
Definition: pointf.h:23
Definition: scene_world.h:50
Definition: wld_pathopener.h:28