1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-09 01:07:16 +01:00
SqMod/source/Base/Vector2i.hpp

413 lines
13 KiB
C++
Raw Normal View History

2015-09-30 02:56:11 +02:00
#ifndef _BASE_VECTOR2I_HPP_
#define _BASE_VECTOR2I_HPP_
// ------------------------------------------------------------------------------------------------
#include "SqBase.hpp"
2015-09-30 02:56:11 +02:00
// ------------------------------------------------------------------------------------------------
namespace SqMod {
/* ------------------------------------------------------------------------------------------------
*
2015-09-30 02:56:11 +02:00
*/
struct Vector2i
{
/* --------------------------------------------------------------------------------------------
* ...
*/
typedef int Value;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static const Vector2i NIL;
static const Vector2i MIN;
static const Vector2i MAX;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
static SQChar Delim;
/* --------------------------------------------------------------------------------------------
* ...
*/
2015-09-30 02:56:11 +02:00
Value x, y;
/* --------------------------------------------------------------------------------------------
*
*/
Vector2i();
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i(Value sv);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i(Value xv, Value yv);
/* --------------------------------------------------------------------------------------------
*
*/
Vector2i(const Vector2i & o);
/* --------------------------------------------------------------------------------------------
*
*/
2015-09-30 02:56:11 +02:00
~Vector2i();
/* --------------------------------------------------------------------------------------------
*
*/
Vector2i & operator = (const Vector2i & o);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator = (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator = (CSStr values);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator = (const Vector2 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator += (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator -= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator *= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator /= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator %= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator &= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator |= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator ^= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator <<= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator >>= (const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator += (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator -= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator *= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator /= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator %= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator &= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator |= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator ^= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator <<= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator >>= (Value s);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator ++ ();
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i & operator -- ();
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator ++ (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator -- (int);
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator + (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator - (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator * (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator / (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator % (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator & (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator | (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator ^ (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator << (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator >> (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator + (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator - (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator * (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator / (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator % (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator & (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator | (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator ^ (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator << (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator >> (Value s) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator + () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator - () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i operator ~ () const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator == (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator != (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator < (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator > (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator <= (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
bool operator >= (const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
Int32 Cmp(const Vector2i & v) const;
/* --------------------------------------------------------------------------------------------
* ...
*/
CSStr ToString() const;
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value ns);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(Value nx, Value ny);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector2i & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(const Vector2 & v);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Set(CSStr values, SQChar delim);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate();
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate(Value min, Value max);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Generate(Value xmin, Value xmax, Value ymin, Value ymax);
/* --------------------------------------------------------------------------------------------
* ...
*/
void Clear()
{
x = 0, y = 0;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
Vector2i Abs() const;
2015-09-30 02:56:11 +02:00
};
} // Namespace:: SqMod
#endif // _BASE_VECTOR2I_HPP_