home *** CD-ROM | disk | FTP | other *** search
- /*
- Copyright (C) 2000 by Hervé PHILIPPE <rv@bemail.org>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- // ATTENTION : Ces fonctions sont "inline" (voir le fichier "Coordonnees.h")
-
- ///////////////////////////////////////
- // CONSTRUCTEUR n┬░1 de "Coordonnees" //
- ///////////////////////////////////////
- inline
- Coordonnees::Coordonnees()
- // AUCUN PARAMETRE
- {
- x = 0;
- y = 0;
- }
-
- ///////////////////////////////////////
- // CONSTRUCTEUR n┬░2 de "Coordonnees" //
- ///////////////////////////////////////
- inline
- Coordonnees::Coordonnees(const Coordonnees& coordonnees_case)
- // 1 PARAMETRE : ENTREE (@)
- {
- x = coordonnees_case.x;
- y = coordonnees_case.y;
- }
-
- ///////////////////////////////////////
- // CONSTRUCTEUR n┬░3 de "Coordonnees" //
- ///////////////////////////////////////
- inline
- Coordonnees::Coordonnees(TYPE_COORD coord_x, TYPE_COORD coord_y)
- // 2 PARAMETRES : ENTREE ENTREE
- {
- x = coord_x;
- y = coord_y;
- }
-
- //////////////////////////////////
- // DESTRUCTEUR de "Coordonnees" //
- //////////////////////////////////
- inline
- Coordonnees::~Coordonnees()
- // AUCUN PARAMETRE
- {
- }
-
- //////////////////////////
- // FONCTION "operator=" //
- //////////////////////////
- inline
- Coordonnees& // VALEUR DE RETOUR
- Coordonnees::operator=(const Coordonnees& coordonnees_case)
- // 1 PARAMETRE : ENTREE (@)
- {
- x = coordonnees_case.x;
- y = coordonnees_case.y;
- return *this;
- }
-
- //////////////////////////
- // FONCTION "operator+" //
- //////////////////////////
- inline
- Coordonnees // VALEUR DE RETOUR
- Coordonnees::operator+(const Coordonnees& coordonnees_case) const
- // 1 PARAMETRE : ENTREE (@)
- {
- Coordonnees coordonnees_somme(*this);
- coordonnees_somme.x += coordonnees_case.x;
- coordonnees_somme.y += coordonnees_case.y;
- return coordonnees_somme;
- }
-
- //////////////////////////
- // FONCTION "operator-" //
- //////////////////////////
- inline
- Coordonnees // VALEUR DE RETOUR
- Coordonnees::operator-(const Coordonnees& coordonnees_case) const
- // 1 PARAMETRE : ENTREE (@)
- {
- Coordonnees coordonnees_somme(*this);
- coordonnees_somme.x -= coordonnees_case.x;
- coordonnees_somme.y -= coordonnees_case.y;
- return coordonnees_somme;
- }
-
- ///////////////////////////
- // FONCTION "operator+=" //
- ///////////////////////////
- inline
- Coordonnees& // VALEUR DE RETOUR
- Coordonnees::operator+=(const Coordonnees& coordonnees_case)
- // 1 PARAMETRE : ENTREE (@)
- {
- x += coordonnees_case.x;
- y += coordonnees_case.y;
- return *this;
- }
-
- ///////////////////////////
- // FONCTION "operator-=" //
- ///////////////////////////
- inline
- Coordonnees& // VALEUR DE RETOUR
- Coordonnees::operator-=(const Coordonnees& coordonnees_case)
- // 1 PARAMETRE : ENTREE (@)
- {
- x -= coordonnees_case.x;
- y -= coordonnees_case.y;
- return *this;
- }
-
- ///////////////////////////
- // FONCTION "operator==" //
- ///////////////////////////
- inline
- bool // VALEUR DE RETOUR
- Coordonnees::operator==(const Coordonnees& coordonnees_case)
- // 1 PARAMETRE : ENTREE (@)
- {
- return x == coordonnees_case.x && y == coordonnees_case.y;
- }
-
- ///////////////////////////
- // FONCTION "operator!=" //
- ///////////////////////////
- inline
- bool // VALEUR DE RETOUR
- Coordonnees::operator!=(const Coordonnees& coordonnees_case)
- // 1 PARAMETRE : ENTREE (@)
- {
- return !(*this == coordonnees_case);
- }
-