Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/home/James/ZEngine-dev/include/ZE_ZRect.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002          This file is Part of the ZEngine Library for SDL Game Development.
00003                       Copyright (C) 2002 ConceptOfZero.net
00004 
00005              Licensed under the BSD License, see licensing.txt.
00006 
00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
00008          and the home of this Library is http://www.conceptofzero.net/
00009 *******************************************************************************/
00010 
00024 #ifndef __ze_zrect_h__
00025 #define __ze_zrect_h__
00026 
00027 #include "ZE_ZObject.h"         //included even though ZRect isn't derived (to obtain all other needed headers)
00028 
00029 namespace ZE
00030 {
00031 
00037 class ZRect
00038 {
00039         private:
00041                 int mX;
00043                 int mY;
00045                 int mWidth;
00047                 int mHeight;
00048 
00049         public:
00050 
00056                 ZRect();
00057 
00067                 ZRect(int x, int y, int width, int height);
00068 
00075                 ZRect(const ZRect &rhs);
00076 
00084                 const ZRect& operator=(const ZRect &rhs);
00085 
00094                 bool operator<(const ZRect &rhs) const;
00095 
00103                 void Move(int x, int y);
00104 
00112                 void MoveRel(int xMove, int yMove);
00113 
00121                 void Resize(int width, int height);
00122 
00130                 void ResizeRel(int widthChange, int heightChange);
00131 
00139                 bool Intersects(const ZRect &rect) const;
00140 
00149                 bool Contains(int x, int y) const;
00150 
00158                 bool Contains(const ZRect &rect) const;
00159 
00167                 ZRect Intersection(const ZRect &rect) const;
00168 
00175                 SDL_Rect SDLrect() const;
00176 
00183                 int X() const;
00184 
00191                 int Y() const;
00192 
00199                 int Left() const;
00200 
00207                 int Right() const;
00208 
00215                 int Top() const;
00216 
00223                 int Bottom() const;
00224 
00231                 int Width() const;
00232 
00239                 int Height() const;
00240 };
00241 
00242 } //namspace ZE
00243 
00244 #endif //__ze_zrect_h__

Generated on Wed Nov 20 01:18:05 2002 for ZEngine by doxygen1.3-rc1