Claypool

Courses

Publications

Students

Projects

Service

Downloads

Misc


Dragonfly: Vector.h Source File
Dragonfly 2.2
A text-based game engine

Vector.h

00001 //
00002 // A 2-d Vector class
00003 //
00004 
00005 #ifndef __VECTOR_H__
00006 #define __VECTOR_H__
00007 
00008 class Vector {
00009 
00010  protected:
00011   float x;                      ///< Horizontal coordinate in 2d world.
00012   float y;                      ///< Vertical coordinate in 2d world.
00013 
00014  public:
00015 
00016   Vector(float init_x, float init_y);
00017 
00018   /// Default vector is (0,0).
00019   Vector();
00020 
00021   ~Vector();
00022 
00023   float getX();                 ///< Get horizontal coordinate.
00024   void setX(float new_x);       ///< Set horizontal coordinate.
00025   float getY();                 ///< Get vertical coordinate.
00026   void setY(float new_y);       ///< Set vertical coordinate.
00027 };
00028 
00029 #endif //__VECTOR_H__
00030 
 All Classes Functions Variables Friends