home *** CD-ROM | disk | FTP | other *** search
/ Freelog 17 / Freelog017.iso / BeOS / ababelone / Sources / Coordonnees.h < prev    next >
C/C++ Source or Header  |  2000-11-06  |  2KB  |  55 lines

  1. /*
  2.     Copyright (C) 2000 by Herv├⌐ PHILIPPE <rv@bemail.org>
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public
  15.     License along with this library; if not, write to the Free
  16.     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. */
  18.  
  19. #ifndef _COORDONNEES_H_
  20. #define _COORDONNEES_H_
  21.  
  22. #include <SupportDefs.h>    // Pour int8
  23.  
  24. #define TYPE_COORD    int8
  25. #define COORD_NULL    Coordonnees(-1, -1)
  26.  
  27. class Coordonnees
  28. {
  29. // FONCTIONS
  30.     public:
  31. // Constructeurs
  32.                         Coordonnees();
  33.                         Coordonnees(const Coordonnees& coordonnees_case);
  34.                         Coordonnees(TYPE_COORD coord_x, TYPE_COORD coord_y);
  35. // Destructeur
  36.                         ~Coordonnees();
  37. // Op├⌐rateurs
  38.         Coordonnees&    operator=(const Coordonnees& coordonnees_case);
  39.         Coordonnees        operator+(const Coordonnees& coordonnees_case) const;
  40.         Coordonnees        operator-(const Coordonnees& coordonnees_case) const;
  41.         Coordonnees&    operator+=(const Coordonnees& coordonnees_case);
  42.         Coordonnees&    operator-=(const Coordonnees& coordonnees_case);
  43.         bool            operator==(const Coordonnees& coordonnees_case);
  44.         bool            operator!=(const Coordonnees& coordonnees_case);
  45.  
  46. // VARIABLES ET CONSTANTES
  47.     public:
  48.         TYPE_COORD        x;
  49.         TYPE_COORD        y;
  50. };
  51.  
  52. #include "Coordonnees.cpp"    // Obligatoire, car ce sont des fonctions "inline" !
  53.  
  54. #endif
  55.