Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Dir Class Reference


Detailed Description

Direction.

Definition at line 9 of file Dir.h.

Public Types

enum  eDir {
  DIR_NO = 0, DIR_UP = 1, DIR_DOWN = 2, DIR_LEFT = 3,
  DIR_RIGHT = 4
}

Static Public Member Functions

static V2 dir2xy (eDir dir)
 Convert dir to relative coordinations.


Member Enumeration Documentation

enum Dir::eDir
 

Enumeration values:
DIR_NO 
DIR_UP 
DIR_DOWN 
DIR_LEFT 
DIR_RIGHT 

Definition at line 11 of file Dir.h.

00011                   {
00012             DIR_NO = 0,
00013             DIR_UP = 1,
00014             DIR_DOWN = 2,
00015             DIR_LEFT = 3,
00016             DIR_RIGHT = 4
00017         };


Member Function Documentation

V2 Dir::dir2xy eDir  dir  )  [static]
 

Convert dir to relative coordinations.

Definition at line 18 of file Dir.cpp.

00019 {
00020     int x = 0;
00021     int y = 0;
00022     switch (dir) {
00023         case DIR_UP:
00024             y = -1;
00025             break;
00026         case DIR_DOWN:
00027             y = +1;
00028             break;
00029         case DIR_LEFT:
00030             x = -1;
00031             break;
00032         case DIR_RIGHT:
00033             x = +1;
00034             break;
00035         case DIR_NO:
00036             break;
00037         default:
00038             assert(!"unknown dir");
00039             break;
00040     }
00041 
00042     return V2(x, y);
00043 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:54:53 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2