//
//  Immeuble.m
//  Agence
//
//  Created by Olivier Savard on 11-01-21.
//  Copyright 2011 OSInfo Informatique. All rights reserved.
//

#import "Immeuble.h"


@implementation Immeuble
@synthesize immeubleID;
@synthesize type;
@synthesize style;
@synthesize adresse;
@synthesize distance;
@synthesize prix;

#pragma mark NSCoding

-(void)encodeWithCoder:(NSCoder *)aCoder {
	[aCoder encodeInt:immeubleID forKey:kFieldID];
	[aCoder encodeInt:type		forKey:kFieldType];
	[aCoder encodeObject:style		forKey:kFieldStyle];
	[aCoder encodeObject:adresse	forKey:kFieldAdresse];
	[aCoder encodeInt:distance	forKey:kFieldDistance];
	[aCoder encodeInt:prix		forKey:kFieldPrix];
}

-(id)initWithCoder:(NSCoder *)aDecoder {
	if (self = [super init]) {
		self.immeubleID = [aDecoder decodeIntForKey:kFieldID];
		self.type = [aDecoder decodeIntForKey:kFieldType];
		self.style = [aDecoder decodeObjectForKey:kFieldStyle];
		self.adresse = [aDecoder decodeObjectForKey:kFieldAdresse];
		self.distance = [aDecoder decodeIntForKey:kFieldDistance];
		self.prix = [aDecoder decodeIntForKey:kFieldPrix];
	}
	return self;
}
	

-(void)dealloc{
	style.release;
	adresse.release;
	[super dealloc];
}

@end
