CPP02 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Point.cpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Point.cpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/04/28 17:18:16 by kamitsui #+# #+# */
9/* Updated: 2025/05/06 17:37:50 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
22#include "Point.hpp"
23#include <iostream>
24
30Point::Point() : x(0.0f), y(0.0f) {}
31
39Point::Point(const float x_val, const float y_val) : x(x_val), y(y_val) {}
40
47Point::Point(const Point &other) : x(other.x), y(other.y) {}
48
58 if (this != &other) {
59 (void)other; // To avoid unused parameter warning
60 }
61 return *this;
62}
63
68
74Fixed Point::getX() const { return this->x; }
75
81Fixed Point::getY() const { return this->y; }
Header file for the Point class representing a 2D point with Fixed coordinates.
ex00 Fixed Class
Definition Fixed.hpp:28
Fixed getY() const
Gets the y-coordinate of the point.
Definition Point.cpp:81
~Point()
Destructor.
Definition Point.cpp:67
Fixed getX() const
Gets the x-coordinate of the point.
Definition Point.cpp:74
Point()
Default constructor.
Definition Point.cpp:30
Point & operator=(const Point &other)
Copy assignment operator.
Definition Point.cpp:57