//
//  BuddyMessageRequest.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 "BuddyMessageRequest.h"
#import "GenericMessageType.h"

@implementation BuddyMessageRequest

-(id)initWithMessage:(NSString *)message targetBuddy:(id <Buddy>)targetBuddy  params:(id <ISFSObject>)params {

	if ((self = [super init])) {
		
		_type = GenericMessageType_BUDDY_MSG;
		self.message = message;
		self.recipient = targetBuddy != nil ? [NSNumber numberWithInt:(int)[targetBuddy id]] : [NSNumber numberWithInt:-1];  
		self.params = params;
	}
	return self;
}

+(id)requestWithMessage:(NSString *)message targetBuddy:(id <Buddy>)targetBuddy  params:(id <ISFSObject>)params {
	BuddyMessageRequest *req = [[BuddyMessageRequest alloc] initWithMessage:message targetBuddy:targetBuddy params:params];
	return req;
}

+(id)requestWithMessage:(NSString *)message targetBuddy:(id <Buddy>)targetBuddy {
	BuddyMessageRequest *req = [[BuddyMessageRequest alloc] initWithMessage:message targetBuddy:targetBuddy params:nil];
	return req;
}


@end
