#if !defined(LINE_H)
#define LINE_H

#include "Point.h"
#include "Shape.h"
#include <iostream>
using namespace std;

class Line: virtual public Shape, virtual public Hashable{
	private:
	    static unsigned long int count;

	    static unsigned long int total;

		const unsigned long int id;

		Point* p1; 

		Point* p2;

	public:
		Line();

		Line(Point* p1, Point* p2);

		Line(const Line& o);

		Line(const Line* o);

		virtual ~Line();

		Point* getPoint(int n);

		ostream& print(ostream& os) const;

		string toString() const;

		Line& operator= (const Line& o);

		int operator==(const Line& o) const;

		void moveBy(const double x, const double y);

		unsigned long int getObjectId() const{
			return id;
		}

		static unsigned long int getNumberOfObjects(){ //const
			return count;
		}

		int hashCode() const{
			return buildHashCode(toString());
		}
};

#endif
Соседние файлы в папке lab2_1