NTU-OOP-Tuts-2024-Cpp/T8Q2_2/Polygon.cpp

31 lines
637 B
C++
Raw Normal View History

2024-10-30 07:36:34 +08:00
//
// Created by Marcus Vinícius de Carvalho
//
#include "Polygon.h"
#include <iostream>
Polygon::Polygon(string name, const float width, const float height)
: name(std::move(name)), width(width), height(height) {
polytype = POLY_PLAIN;
}
KindOfPolygon Polygon::getPolytype() const {
return polytype;
}
void Polygon::setPolytype(KindOfPolygon polytype) {
this->polytype = polytype;
}
string Polygon::getName() {
return name;
}
float Polygon::calculateArea() {
return 0.0;
}
void Polygon::printWidthHeight() const {
cout << "Name: " << name << "; Width: " << width << "; Height: " << height << endl;
};