ScummVM API documentation
star_ref.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 #include "titanic/star_control/base_stars.h"
23 #include "common/rect.h"
24 
25 #ifndef TITANIC_STAR_REF_H
26 #define TITANIC_STAR_REF_H
27 
28 namespace Titanic {
29 
30 class CCamera;
31 class CSurfaceArea;
32 
33 class CBaseStarRef {
34 protected:
35  CBaseStars *_stars;
36 public:
37  CBaseStarRef(CBaseStars *stars) : _stars(stars) {}
38  CBaseStarRef() : _stars(nullptr) {}
39  virtual ~CBaseStarRef() {}
40 
41  void process(CSurfaceArea *surface, CCamera *camera);
42 
43  virtual bool check(const Common::Point &pt, int index) { return false; }
44 };
45 
46 class CStarRef1 : public CBaseStarRef {
47 private:
48  Common::Point _position;
49 public:
50  int _index;
51 public:
52  CStarRef1(CBaseStars *stars, const Common::Point &pt) :
53  CBaseStarRef(stars), _position(pt), _index(-1) {}
54  ~CStarRef1() override {}
55 
56  bool check(const Common::Point &pt, int index) override;
57 };
58 
59 class CStarRefArray : public CBaseStarRef {
60 private:
61  Common::Array<CStarPosition> *_positions;
62 public:
63  int _index;
64 public:
66  CBaseStarRef(stars), _positions(positions), _index(0) {}
67  ~CStarRefArray() override {}
68 
69  bool check(const Common::Point &pt, int index) override;
70 };
71 
72 class CStarRef3 : public CBaseStarRef {
73 public:
74  int _index;
75 public:
76  CStarRef3(CBaseStars *stars) :CBaseStarRef(stars), _index(0) {}
77  ~CStarRef3() override {}
78 
79  bool check(const Common::Point &pt, int index) override;
80 };
81 
82 } // End of namespace Titanic
83 
84 #endif /* TITANIC_STAR_REF_H */
Definition: surface_area.h:36
Definition: array.h:52
Definition: star_ref.h:59
Definition: camera.h:42
Definition: rect.h:45
Definition: arm.h:30
Definition: star_ref.h:33
Definition: star_ref.h:72
Definition: base_stars.h:74
Definition: star_ref.h:46