El Octavio  1.0
This is a video game about adventures.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Vector2.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org)
5//
6// This software is provided 'as-is', without any express or implied warranty.
7// In no event will the authors be held liable for any damages arising from the use of this software.
8//
9// Permission is granted to anyone to use this software for any purpose,
10// including commercial applications, and to alter it and redistribute it freely,
11// subject to the following restrictions:
12//
13// 1. The origin of this software must not be misrepresented;
14// you must not claim that you wrote the original software.
15// If you use this software in a product, an acknowledgment
16// in the product documentation would be appreciated but is not required.
17//
18// 2. Altered source versions must be plainly marked as such,
19// and must not be misrepresented as being the original software.
20//
21// 3. This notice may not be removed or altered from any source distribution.
22//
24
25#ifndef SFML_VECTOR2_HPP
26#define SFML_VECTOR2_HPP
27
28
29namespace sf
30{
36template <typename T>
38{
39public:
40
48
56 Vector2(T X, T Y);
57
69 template <typename U>
70 explicit Vector2(const Vector2<U>& vector);
71
73 // Member data
75 T x;
76 T y;
77};
78
88template <typename T>
90
104template <typename T>
106
120template <typename T>
122
133template <typename T>
134Vector2<T> operator +(const Vector2<T>& left, const Vector2<T>& right);
135
146template <typename T>
147Vector2<T> operator -(const Vector2<T>& left, const Vector2<T>& right);
148
159template <typename T>
160Vector2<T> operator *(const Vector2<T>& left, T right);
161
172template <typename T>
173Vector2<T> operator *(T left, const Vector2<T>& right);
174
188template <typename T>
190
201template <typename T>
202Vector2<T> operator /(const Vector2<T>& left, T right);
203
217template <typename T>
219
232template <typename T>
233bool operator ==(const Vector2<T>& left, const Vector2<T>& right);
234
247template <typename T>
248bool operator !=(const Vector2<T>& left, const Vector2<T>& right);
249
251
252// Define the most common types
256
257} // namespace sf
258
259
260#endif // SFML_VECTOR2_HPP
261
262
Vector2< T > & operator-=(Vector2< T > &left, const Vector2< T > &right)
Definition: Vector2.inl:77
Vector2< T > operator-(const Vector2< T > &right)
Definition: Vector2.inl:58
Vector2< T > operator*(const Vector2< T > &left, T right)
Definition: Vector2.inl:104
Vector2< T > operator+(const Vector2< T > &left, const Vector2< T > &right)
Definition: Vector2.inl:88
Vector2< T > operator/(const Vector2< T > &left, T right)
Definition: Vector2.inl:131
Vector2< T > & operator*=(Vector2< T > &left, T right)
Definition: Vector2.inl:120
Vector2< T > & operator/=(Vector2< T > &left, T right)
Definition: Vector2.inl:139
Vector2< T > & operator+=(Vector2< T > &left, const Vector2< T > &right)
Definition: Vector2.inl:66
Utility template class for manipulating 2-dimensional vectors.
Definition: Vector2.hpp:38
T x
X coordinate of the vector.
Definition: Vector2.hpp:75
Vector2(const Vector2< U > &vector)
Construct the vector from another type of vector.
T y
Y coordinate of the vector.
Definition: Vector2.hpp:76
Vector2()
Default constructor.
Vector2(T X, T Y)
Construct the vector from its coordinates.
Vector2< unsigned int > Vector2u
Definition: Vector2.hpp:254
SFML_NETWORK_API bool operator==(const IpAddress &left, const IpAddress &right)
Overload of == operator to compare two IP addresses.
Vector2< int > Vector2i
Definition: Vector2.hpp:253
Vector2< float > Vector2f
Definition: Vector2.hpp:255
SFML_NETWORK_API bool operator!=(const IpAddress &left, const IpAddress &right)
Overload of != operator to compare two IP addresses.