#import "CTRentalProperty.h"

@implementation CTRentalProperty

- (void)increaseRentalByPercent:(float)percent 
   withMaximum:(float)max
{
   rentalPrice = rentalPrice * (100 + percent) / 100;
   rentalPrice = fmin(rentalPrice, max);
}

- (void)decreaseRentalByPercent:(float)percent 
   withMinimum:(float)min 
{
   rentalPrice = rentalPrice * (100 - percent) / 100;
   rentalPrice = fmax(rentalPrice, min);
}

- (void)setRentalPrice:(float)newRentalPrice
{
   rentalPrice = newRentalPrice;
}

- (float)rentalPrice
{
   return rentalPrice;
}

- (void)setAddress:(NSString *)newAddress
{
   [address autorelease];
   address = [newAddress copy]; 
}

- (NSString *)address
{
   return address;
}

- (void)setPropertyType:(PropertyType)newPropertyType
{
   propertyType = newPropertyType;
}

- (PropertyType)propertyType
{
   return propertyType;
}

@end
