//
//  SFSInvitation.m
//  SFS2X
//
//  Original development by Infosfer Game Technologies Ltd. | http://www.infosfer.com.
//
//  Maintained and developed by A51 Integrated.
//  Copyright 2012 A51 Integrated | http://a51integrated.com. All rights reserved.
//

#import "SFSInvitation.h"
#import "ISFSObject.h"

@implementation SFSInvitation


@dynamic id;
@dynamic inviter;
@dynamic invitee;
@dynamic secondsForAnswer;
@dynamic params;


-(id)initWithInviter:(id <User>)inviter invitee:(id <User>)invitee secondsForAnswer:(NSInteger)secondsForAnswer params:(id <ISFSObject>)params {

	if ((self = [super init])) {
		_inviter = inviter;
		_invitee = invitee;
		_secondsForAnswer = secondsForAnswer;
		_params = params;
	}
	
	return self;
}

+(id)invitationWithInviter:(id <User>)inviter invitee:(id <User>)invitee secondsForAnswer:(NSInteger)secondsForAnswer params:(id <ISFSObject>)params {
	SFSInvitation *newInstance = [[SFSInvitation alloc] initWithInviter:inviter invitee:invitee secondsForAnswer:secondsForAnswer params:params];
	return newInstance;
}

+(id)invitationWithInviter:(id <User>)inviter invitee:(id <User>)invitee {
	SFSInvitation *newInstance = [[SFSInvitation alloc] initWithInviter:inviter invitee:invitee secondsForAnswer:15 params:nil];
	return newInstance;
}


#pragma mark Invitation protocol

-(NSInteger)id {
	return _id;
}
-(void)setId:(NSInteger)value {
	_id = value;
}

-(id <User>)inviter {
	return _inviter;
}
-(id <User>)invitee {
	return _invitee;
}

-(NSInteger)secondsForAnswer {
	return _secondsForAnswer;
}
-(id <ISFSObject>)params {
	return _params;
}

@end
