Claypool

Courses

Publications

Students

Projects

Service

Downloads

Misc


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

Line.h

00001 ///
00002 /// Line.h - a line segment
00003 ///
00004 
00005 #ifndef __LINE_H__
00006 #define __LINE_H__
00007 
00008 #include "Position.h"
00009 
00010 class Line {
00011 
00012  protected:
00013   Position p1;                  ///< first endpoint
00014   Position p2;                  ///< second endpoint
00015 
00016  public:
00017 
00018   /// Create line segment from p1 to p2
00019   Line(Position init_p1, Position init_p2);
00020 
00021   /// Default line segment is at (0,0)
00022   Line();
00023 
00024   ~Line();
00025 
00026   Position getP1();             ///< Get first endpoint
00027   void setP1(Position new_p1);  ///< Set first endpoint
00028   Position getP2();             ///< Get second endpoint
00029   void setP2(Position new_p2);  ///< Set second endpoint
00030 };
00031 
00032 #endif //__LINE_H__
00033 
 All Classes Functions Variables Friends