//
//  MPT_FAsetup.m
//  FeatureAveraging
//
//  Created by Andrew Salamon on 8/12/08.
//  Copyright 2008 Machine Perception Laboratory, University of California San Diego.. All rights reserved.
//

#import "MPT_FAsetup.h"


@implementation MPT_FAsetup
- (id)initWithName:(NSString *)_name iname:(NSString *)_iname plugin:(id)_plugin
{
	if( self = [super init] )
	{
		name = [_name retain];
		iname = [_iname retain];
		plugin = _plugin;
		included = NO;
	}
	
	return self;
}

- (void)dealloc
{
	[name release];
	[iname release];
	[super dealloc];
}

- (NSString *)name {
    return [[name retain] autorelease];
}

- (NSString *)iname {
    return [[iname retain] autorelease];
}

- (id)plugin
{
    return plugin;
}

- (BOOL)included {
    return included;
}
- (void)setIncluded:(BOOL)value {
    if (included != value) {
        included = value;
		if( [delegate respondsToSelector:@selector(stateDidChange)] )
			[delegate performSelector:@selector(stateDidChange)];
    }
}

- (id)copyWithZone:(NSZone *)zone
{
	MPT_FAsetup *cp = [[MPT_FAsetup alloc] initWithName:[self name] iname:[self iname] plugin:[self plugin]];
	[cp setIncluded:[self included]];
	return cp;
}

- (id)delegate
{
    return [[delegate retain] autorelease];
}
- (void)setDelegate:(id)value
{
	delegate = value;
}


@end
