Friday, April 3, 2009

An example

It seems silly I had to type this when nearly all of it could have been derived from the contents of my implementation.



import <Foundation/Foundation.h>
#import <UIKit/UIColor.h>

@interface UIColor(WarcraftKlass)

+(UIColor *)warriorColor;
+(UIColor *)paladinColor;
+(UIColor *)hunterColor;
+(UIColor *)rogueColor;
+(UIColor *)priestColor;
+(UIColor *)deathKnightColor;
+(UIColor *)shamanColor;
+(UIColor *)mageColor;
+(UIColor *)warlockColor;
+(UIColor *)druidColor;
@end

I am still getting my feet wet with Objective-C, so there is some chance I may discover metaprogramming tricks such as Ruby and other allow. In that case, a lot of my code will get smaller and more readable. We shall see.

No comments:

Post a Comment