Point.h

Go to the documentation of this file.
00001 //**********************************************************************
00002 //
00003 //  REGCOM: Regimental Command
00004 //  Copyright (C) 2008 Randi J. Relander
00005 //    <rjrelander@users.sourceforge.net>
00006 //
00007 //  This program is free software; you can redistribute it and/or
00008 //  modify it under the terms of the GNU General Public License
00009 //  as published by the Free Software Foundation; either version 3
00010 //  of the License, or (at your option) any later version.
00011 //  
00012 //  This program is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU General Public License for more details.
00016 //  
00017 //  You should have received a copy of the GNU General Public
00018 //  License along with this program.  If not, see 
00019 //  <http://www.gnu.org/licenses/>.
00020 //  
00021 //**********************************************************************
00022 
00023 #ifndef REGCOM_GUI_POINT_H
00024 #define REGCOM_GUI_POINT_H
00025 
00026 // NAMESPACES
00027 namespace regcom {
00028 namespace gui {
00029 
00031 //  CLASS: Point
00037 class Point
00038 {
00039 public:
00040 
00041     // PUBLIC METHODS
00042 
00044     Point() {}
00045 
00047     Point(int x, int y) { this->x = x; this->y = y; }
00048     
00050     virtual ~Point() {}
00051 
00053     int GetX() const { return x; }
00054 
00056     int GetY() const { return y; }
00057 
00059     bool IsEqual(Point p) const { return (x == p.x) && (y == p.y); }
00060 
00062     bool IsEqual(int x, int y) const { return IsEqual(Point(x,y)); }
00063 
00064 public:
00065 
00066     // MEMBER VARIABLES
00067 
00069     int x;
00070 
00072     int y;
00073 };
00074 
00075 } // namespace gui
00076 } // namespace regcom
00077 
00078 #endif