APLOC2/Week1/APLOC2 Week 1/APLOC2 Week 1/insectFactory.m
2013-02-12 20:25:31 -05:00

32 lines
565 B
Objective-C

//
// insectFactory.m
// APLOC2 Week 1
//
// Created by Brent Marohnic on 2/11/13.
// Copyright (c) 2013 Brent Marohnic. All rights reserved.
//
#import "insectFactory.h"
@implementation insectFactory
+(baseInsect *)createNewInsect:(int)insectType
{
if (insectType == CRICKET)
{
return [[cricketInsect alloc] init];
}
else if (insectType == BUTTERFLY)
{
return [[butterflyInsect alloc] init];
}
else if (insectType == ANT)
{
return [[antInsect alloc] init];
}
else return nil;
}
@end