From: chsieh Date: Tue, 17 May 2011 04:43:30 +0000 (-0700) Subject: Adding back UnitDelegate protocol. X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=64c5b1ecd374b553215c105ea75ae03805d2d096;p=tanks-ios.git Adding back UnitDelegate protocol. --- diff --git a/src/game/actor/Unit.h b/src/game/actor/Unit.h index 5ce2e6d..3fffdaa 100644 --- a/src/game/actor/Unit.h +++ b/src/game/actor/Unit.h @@ -1,7 +1,10 @@ #import "Sparrow.h" + #import "render/QQSparrowExtensions.h" #import "game/actor/Actor.h" +#import "game/actor/UnitDelegate.h" + #import "physics/World.h" @@ -9,11 +12,13 @@ @interface Unit : Actor { @private - SPDisplayObject* _shape; + SPDisplayObject* _shape; + id _delegate; } //////////////////////////////////////////////////////////////////////////////////// @property (nonatomic, retain, readwrite) SPDisplayObject* shape; +@property (nonatomic, retain, readwrite) id delegate; //////////////////////////////////////////////////////////////////////////////////// - (id) initWithFile:(NSString*)fileName atX:(float)x y:(float)y; diff --git a/src/game/actor/Unit.mm b/src/game/actor/Unit.mm index 88e057a..2c6b4d5 100644 --- a/src/game/actor/Unit.mm +++ b/src/game/actor/Unit.mm @@ -7,6 +7,7 @@ //////////////////////////////////////////////////////////////////////////////////// @synthesize shape = _shape; +@synthesize delegate = _delegate; //////////////////////////////////////////////////////////////////////////////////// - (id) init { diff --git a/src/game/actor/UnitDelegate.h b/src/game/actor/UnitDelegate.h index 4002d36..74e2d1a 100644 --- a/src/game/actor/UnitDelegate.h +++ b/src/game/actor/UnitDelegate.h @@ -1,14 +1,3 @@ -// -// UnitDelegate.h -// tanks -// -// Created by Doris Chen on 5/14/11. -// Copyright 2011 __MyCompanyName__. All rights reserved. -// - -#import - - -@protocol UnitDelegate +@protocol UnitDelegate -(void)updateWithTick:(float)time; @end