//
//  XTTriple.m
//  XTads
//
//  Created by Rune Berg on 01/08/2021.
//  Copyright © 2021 Rune Berg. All rights reserved.
//

#import "XTTriple.h"


@implementation XTTriple

@synthesize firstObject = _firstObject;
@synthesize secondObject = _secondObject;
@synthesize thirdObject = _thirdObject;

+ (instancetype)tripleWithFirstObject:(NSObject *)firstObject
						 secondObject:(NSObject *)secondObject
						  thirdObject:(NSObject *)thirdObject
{
	XTTriple *res = [[XTTriple alloc] initWithFirstObject:firstObject
											 secondObject:secondObject
											  thirdObject:thirdObject];
	return res;
}

- (instancetype)initWithFirstObject:(NSObject *)firstObject
					   secondObject:(NSObject *)secondObject
						thirdObject:(NSObject *)thirdObject
{
	self = [super init];
	if (self) {
		_firstObject = firstObject;
		_secondObject = secondObject;
		_thirdObject = thirdObject;
	}
	return self;
}

- (NSUInteger)valueCount
{
	NSUInteger res = 0;
	if (self.firstObject != nil) {
		res += 1;
	}
	if (self.secondObject != nil) {
		res += 1;
	}
	if (self.thirdObject != nil) {
		res += 1;
	}
	return res;
}

@end
