mirror of
https://github.com/nednal12/APLOC2.git
synced 2024-06-01 10:41:30 +00:00
32 lines
565 B
Objective-C
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
|