<commit_before>/*********************************
** Tsunagari Tile Engine        **
** vec.h                        **
** Copyright 2011-2012 OmegaSDG **
*********************************/

#ifndef VEC_H
#define VEC_H

template<class T>
class vec2
{
public:
	T x, y;

	vec2()
	{
	}

	vec2(const vec2<T>& other)
		: x(other.x), y(other.y)
	{
	}

	vec2(T x, T y)
		: x(x), y(y)
	{
	}

	vec2<T>& operator +=(const vec2<T>& other)
	{
		x += other.x;
		y += other.y;
		return *this;
	}

	vec2<T>& operator -=(const vec2<T>& other)
	{
		x -= other.x;
		y -= other.y;
		return *this;
	}

	vec2<T>& operator *=(const vec2<T>& other)
	{
		x *= other.x;
		y *= other.y;
		return *this;
	}

	vec2<T>& operator *=(T coefficient)
	{
		x *= coefficient;
		y *= coefficient;
		return *this;
	}

	vec2<T>& operator /=(const vec2<T>& other)
	{
		x /= other.x;
		y /= other.y;
		return *this;
	}

	vec2<T>& operator /=(T coefficient)
	{
		x /= coefficient;
		y /= coefficient;
		return *this;
	}

	operator bool()
	{
		return x || y;
	}
};


template<class T>
class vec3
{
public:
	T x, y, z;

	vec3()
	{
	}

	vec3(const vec3<T>& other)
		: x(other.x), y(other.y), z(other.z)
	{
	}

	vec3(T x, T y, T z)
		: x(x), y(y), z(z)
	{
	}

	vec3<T>& operator +=(const vec3<T>& other)
	{
		x += other.x;
		y += other.y;
		z += other.z;
		return *this;
	}

	vec3<T>& operator -=(const vec3<T>& other)
	{
		x -= other.x;
		y -= other.y;
		z -= other.z;
		return *this;
	}

	vec3<T>& operator *=(const vec3<T>& other)
	{
		x *= other.x;
		y *= other.y;
		z *= other.z;
		return *this;
	}

	vec3<T>& operator *=(T coefficient)
	{
		x *= coefficient;
		y *= coefficient;
		z *= coefficient;
		return *this;
	}

	vec3<T>& operator /=(const vec3<T>& other)
	{
		x /= other.x;
		y /= other.y;
		z /= other.z;
		return *this;
	}

	vec3<T>& operator /=(T coefficient)
	{
		x /= coefficient;
		y /= coefficient;
		z /= coefficient;
		return *this;
	}

	operator bool()
	{
		return x || y || z;
	}
};

template<class T>
bool operator==(const vec3<T>& a, const vec3<T>& b)
{
	return a.x == b.x && a.y == b.y && a.z == b.z;
}

//! Integer vector.
typedef vec2<int> ivec2;
typedef vec3<int> ivec3;

//! Real vector.
typedef vec2<double> rvec2;
typedef vec3<double> rvec3;

//! Coordinates.
typedef ivec3 icoord;
typedef rvec3 rcoord;


void exportVecs();

#endif

<commit_msg>regression: player movement stack resumes on keyup<commit_after>/*********************************
** Tsunagari Tile Engine        **
** vec.h                        **
** Copyright 2011-2012 OmegaSDG **
*********************************/

#ifndef VEC_H
#define VEC_H

template<class T>
class vec2
{
public:
	T x, y;

	vec2()
	{
	}

	vec2(const vec2<T>& other)
		: x(other.x), y(other.y)
	{
	}

	vec2(T x, T y)
		: x(x), y(y)
	{
	}

	vec2<T>& operator +=(const vec2<T>& other)
	{
		x += other.x;
		y += other.y;
		return *this;
	}

	vec2<T>& operator -=(const vec2<T>& other)
	{
		x -= other.x;
		y -= other.y;
		return *this;
	}

	vec2<T>& operator *=(const vec2<T>& other)
	{
		x *= other.x;
		y *= other.y;
		return *this;
	}

	vec2<T>& operator *=(T coefficient)
	{
		x *= coefficient;
		y *= coefficient;
		return *this;
	}

	vec2<T>& operator /=(const vec2<T>& other)
	{
		x /= other.x;
		y /= other.y;
		return *this;
	}

	vec2<T>& operator /=(T coefficient)
	{
		x /= coefficient;
		y /= coefficient;
		return *this;
	}

	operator bool()
	{
		return x || y;
	}
};


template<class T>
class vec3
{
public:
	T x, y, z;

	vec3()
	{
	}

	vec3(const vec3<T>& other)
		: x(other.x), y(other.y), z(other.z)
	{
	}

	vec3(T x, T y, T z)
		: x(x), y(y), z(z)
	{
	}

	vec3<T>& operator +=(const vec3<T>& other)
	{
		x += other.x;
		y += other.y;
		z += other.z;
		return *this;
	}

	vec3<T>& operator -=(const vec3<T>& other)
	{
		x -= other.x;
		y -= other.y;
		z -= other.z;
		return *this;
	}

	vec3<T>& operator *=(const vec3<T>& other)
	{
		x *= other.x;
		y *= other.y;
		z *= other.z;
		return *this;
	}

	vec3<T>& operator *=(T coefficient)
	{
		x *= coefficient;
		y *= coefficient;
		z *= coefficient;
		return *this;
	}

	vec3<T>& operator /=(const vec3<T>& other)
	{
		x /= other.x;
		y /= other.y;
		z /= other.z;
		return *this;
	}

	vec3<T>& operator /=(T coefficient)
	{
		x /= coefficient;
		y /= coefficient;
		z /= coefficient;
		return *this;
	}

	operator bool()
	{
		return x || y || z;
	}
};

template<class T>
bool operator==(const vec2<T>& a, const vec2<T>& b)
{
	return a.x == b.x && a.y == b.y;
}

template<class T>
bool operator==(const vec3<T>& a, const vec3<T>& b)
{
	return a.x == b.x && a.y == b.y && a.z == b.z;
}

//! Integer vector.
typedef vec2<int> ivec2;
typedef vec3<int> ivec3;

//! Real vector.
typedef vec2<double> rvec2;
typedef vec3<double> rvec3;

//! Coordinates.
typedef ivec3 icoord;
typedef rvec3 rcoord;


void exportVecs();

#endif


{'fraction_non_alphanumeric': 0.21989202657807308, 'fraction_numerical': 0.02117940199335548, 'mean_word_length': 2.7053846153846153, 'pattern_counts': {'":': 0, '<': 68, '<?xml version=': 0, '>': 68, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '39177', 'n_tokens_mistral': 2312, 'n_tokens_neox': 2118, 'n_words': 520}