From 64c5b1ecd374b553215c105ea75ae03805d2d096 Mon Sep 17 00:00:00 2001 From: chsieh Date: Mon, 16 May 2011 21:43:30 -0700 Subject: [PATCH] Adding back UnitDelegate protocol. --- src/game/actor/Unit.h | 7 ++++++- src/game/actor/Unit.mm | 1 + src/game/actor/UnitDelegate.h | 13 +------------ 3 files changed, 8 insertions(+), 13 deletions(-) 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 -- 1.7.0.4