6 #include <Framework/IShape.h>
36 template<
class TA,
class TB>
45 auto shape =
new Point(X座標, Y座標);
46 shape->zoomX = this->
zoomX;
47 shape->zoomY = this->
zoomY;
51 void SetPos(
double X座標,
double Y座標)
override
57 void Move(
double X移動量,
double Y移動量)
override
63 double GetX()
const override
68 double GetY()
const override
73 double GetW()
const override
78 double GetH()
const override
93 void Draw(
const Color &描画色)
const override;
97 return shape->
Hit(
this);
101 for (
auto it : complex->
shapes)
103 if (it->Hit(
this))
return true;
109 return (point->
x == this->x && point->
y == this->y);
111 bool Hit(
const Line *line)
const override;
112 bool Hit(
const Rect *rect)
const override;
113 bool Hit(
const Circle *circle)
const override;
116 operator SDL_Point()
const
118 return{ (int)
x, (
int)
y };
124 return {this->
x + 加算値.
x , this->
y + 加算値.
y};
129 return{ this->
x - 加算値.
x, this->
y - 加算値.
y };
矩形を表す図形クラス.
Definition: Rect.h:22
double y
座標
Definition: Point.h:26
太さのある線を表す図形クラス.
Definition: Line.h:20
Point(double X座標, double Y座標)
コンストラクタ.
Definition: Point.h:31
double GetW() const override
幅を取得.
Definition: Point.h:73
bool Hit(const Point *point) const override
衝突判定.
Definition: Point.h:107
std::vector< IShape * > shapes
保持するShape
Definition: Complex.h:23
double GetY() const override
Y座標を取得.
Definition: Point.h:68
Point(TA X座標, TB Y座標)
コンストラクタ.
Definition: Point.h:38
Point operator+(const Point &加算値) const
座標の加算.
Definition: Point.h:122
点を表す図形クラス.
Definition: Point.h:22
衝突判定可能な図形の抽象クラス.
Definition: IShape.h:21
virtual bool Hit(const IShape *iShape) const =0
衝突判定.
複合図形を表すクラス.
Definition: Complex.h:20
void Draw(const Color &描画色) const override
描画する.
Definition: ShapeDraw.h:18
色を表すクラス.
Definition: Color.h:11
void SetPos(double X座標, double Y座標) override
指定座標に移動.
Definition: Point.h:51
double GetH() const override
高さを取得.
Definition: Point.h:78
void Rotate(double 回転する角度) override
回転する.
Definition: Point.h:89
bool Hit(const IShape *shape) const override
衝突判定.
Definition: Point.h:95
double zoomX
図形の拡大率
Definition: IPosition.h:14
double x
座標
Definition: Point.h:25
void Move(double X移動量, double Y移動量) override
相対座標で移動.
Definition: Point.h:57
IShape * Clone(double X座標, double Y座標) const override
同じ形の図形を作る.
Definition: Point.h:43
円を表す図形クラス.
Definition: Circle.h:20
void MultiZoom(double X倍率, double Y倍率) override
縦横別で拡大率を掛け算する.
Definition: Point.h:83
double zoomY
図形の拡大率
Definition: IPosition.h:15
bool Hit(const Complex *complex) const override
衝突判定.
Definition: Point.h:99
double GetX() const override
X座標を取得.
Definition: Point.h:63