#pragma once #include #include #include #include #include #include #include #include #include #include #include #ifdef __SWITCH__ #include #else #include #endif #include "math/Math.h" /// \~chinese /// @brief 不可拷贝对象 class Noncopyable { protected: Noncopyable() = default; private: Noncopyable(const Noncopyable &) = delete; Noncopyable &operator=(const Noncopyable &) = delete; }; // 尺寸向量 typedef struct VecSize { int width; int height; // 构造函数,方便初始化 VecSize(int width_ = 0, int height_ = 0) : width(width_), height(height_) {} // 加法运算符重载:两个 VecSize 相加 VecSize operator+(const VecSize &other) const { return VecSize(width + other.width, height + other.height); } // 减法运算符重载:两个 VecSize 相减 VecSize operator-(const VecSize &other) const { return VecSize(width - other.width, height - other.height); } // 等于运算符重载:判断两个 VecSize 是否相等 bool operator==(const VecSize &other) const { return width == other.width && height == other.height; } // 复合赋值加法:当前对象加上另一个 VecSize VecSize &operator+=(const VecSize &other) { width += other.width; height += other.height; return *this; } // 复合赋值减法:当前对象减去另一个 VecSize VecSize &operator-=(const VecSize &other) { width -= other.width; height -= other.height; return *this; } // 乘法 VecSize operator*(float value) const { return VecSize(width * value, height * value); } } VecSize; typedef struct VecPos3 { int x; int y; int z; VecPos3(int x_ = 0, int y_ = 0, int z_ = 0) : x(x_), y(y_), z(z_) {} VecPos3 operator+(const VecPos3 &other) const { return VecPos3(x + other.x, y + other.y, z + other.z); } VecPos3 operator-(const VecPos3 &other) const { return VecPos3(x - other.x, y - other.y, z - other.z); } bool operator==(const VecPos3 &other) const { return x == other.x && y == other.y && z == other.z; } bool operator!=(const VecPos3 &other) const { return x != other.x || y != other.y || z != other.z; } } VecPos3; typedef struct VecFPos3 { float x; float y; float z; VecFPos3(float x_ = 0, float y_ = 0, float z_ = 0) : x(x_), y(y_), z(z_) {} VecFPos3 operator+(const VecFPos3 &other) const { return VecFPos3(x + other.x, y + other.y, z + other.z); } VecFPos3 operator-(const VecFPos3 &other) const { return VecFPos3(x - other.x, y - other.y, z - other.z); } bool operator==(const VecFPos3 &other) const { return x == other.x && y == other.y && z == other.z; } bool operator!=(const VecFPos3 &other) const { return x != other.x || y != other.y || z != other.z; } } VecFPos3; typedef struct VecSpeed3 { float x; float y; float z; VecSpeed3(float x_ = 0, float y_ = 0, float z_ = 0) : x(x_), y(y_), z(z_) {} VecSpeed3 operator+(const VecSpeed3 &other) const { return VecSpeed3(x + other.x, y + other.y, z + other.z); } VecSpeed3 operator-(const VecSpeed3 &other) const { return VecSpeed3(x - other.x, y - other.y, z - other.z); } bool operator==(const VecSpeed3 &other) const { return x == other.x && y == other.y && z == other.z; } } VecSpeed3; enum LE_BlEND_MODE { NONE, LINEARDODGE };