#include "Property.h"

BEGIN_ESTATE_NAMESPACE

// Initializing the static data member
int Property::s_count = 0;


int Property::getCount() {
  return s_count;
}


Property::Property(int price)
  : _id(s_count++),
    _price(price)
{

  PRINT(toString() + " constructed\n");

}

Property::Property(const Property& old) 
  :_id(s_count++),
   _price(old._price)
{
  PRINT(toString() + " copy_constructed\n");
}

Property::~Property() {
 
  PRINT(toString() + " destructed\n");
  
}

void Property::adjustPrice(int new_price) {
  _price = new_price;
}


int Property::getPrice() {
  return _price;
}


string Property::toString() {
    
  stringstream s;

  s << "Property={"
    << "id=" << _id
    << ", price=" << this->_price // this unnecessary here
    << "}";
  
  return s.str();
      
}


END_ESTATE_NAMESPACE