1.1 --- a/Source/DemoBoardView.m Sat Jul 05 17:46:43 2008 -0700
1.2 +++ b/Source/DemoBoardView.m Fri Jul 18 13:26:59 2008 -0700
1.3 @@ -22,6 +22,8 @@
1.4 */
1.5 #import "DemoBoardView.h"
1.6 #import "Game.h"
1.7 +#import "Turn.h"
1.8 +#import "Player.h"
1.9 #import "GGBTextLayer.h"
1.10 #import "QuartzUtils.h"
1.11
1.12 @@ -39,7 +41,7 @@
1.13
1.14 - (IBAction) toggleRemoteOpponent: (id)sender
1.15 {
1.16 - NSAssert(self.game.currentTurn==0,@"Game has already begun");
1.17 + NSAssert(self.game.currentTurnNo==0,@"Game has already begun");
1.18 Player *opponent = [self.game.players objectAtIndex: 1];
1.19 opponent.local = !opponent.local;
1.20 }
1.21 @@ -94,7 +96,7 @@
1.22
1.23 [self startGameNamed: sCurrentGameName];
1.24
1.25 - [_turnSlider bind: @"value" toObject: self withKeyPath: @"game.currentTurn" options: nil];
1.26 + [_turnSlider bind: @"value" toObject: self withKeyPath: @"game.currentTurnNo" options: nil];
1.27 }
1.28
1.29
1.30 @@ -112,12 +114,12 @@
1.31 {
1.32 Game *game = self.game;
1.33 if( object == game ) {
1.34 - NSLog(@"maxTurn = %u, currentTurn = %u",
1.35 - self.game.maxTurn,self.game.currentTurn);
1.36 - NSLog(@"Game state = '%@'", self.game.stateString);
1.37 + NSLog(@"maxTurnNo = %u, currentTurnNo = %u",
1.38 + self.game.maxTurnNo,self.game.currentTurnNo);
1.39 + NSLog(@"Game state = '%@'", self.game.currentTurn.boardState);
1.40
1.41 - _turnSlider.maxValue = self.game.maxTurn;
1.42 - _turnSlider.numberOfTickMarks = self.game.maxTurn+1;
1.43 + _turnSlider.maxValue = self.game.maxTurnNo;
1.44 + _turnSlider.numberOfTickMarks = self.game.maxTurnNo+1;
1.45
1.46 Player *p = game.winner;
1.47 NSString *msg;
1.48 @@ -141,7 +143,7 @@
1.49 - (IBAction) undo: (id)sender
1.50 {
1.51 if( self.game.currentTurn > 0 )
1.52 - self.game.currentTurn--;
1.53 + self.game.currentTurnNo--;
1.54 else
1.55 NSBeep();
1.56 }
1.57 @@ -149,8 +151,8 @@
1.58
1.59 - (IBAction) redo: (id)sender
1.60 {
1.61 - if( self.game.currentTurn < self.game.maxTurn )
1.62 - self.game.currentTurn++;
1.63 + if( self.game.currentTurnNo < self.game.maxTurnNo )
1.64 + self.game.currentTurnNo++;
1.65 else
1.66 NSBeep();
1.67 }