Updated DemoBoardView and the xcode project to work with the latest sources.
authorJens Alfke <jens@mooseyard.com>
Mon Jul 14 21:46:09 2008 -0700 (2008-07-14)
changeset 17ccc5ed68222d
parent 16 28392c9a969f
child 18 ed057f4a72ca
Updated DemoBoardView and the xcode project to work with the latest sources.
GeekGameBoard.xcodeproj/project.pbxproj
Source/DemoBoardView.m
     1.1 --- a/GeekGameBoard.xcodeproj/project.pbxproj	Mon Jul 14 21:00:15 2008 -0700
     1.2 +++ b/GeekGameBoard.xcodeproj/project.pbxproj	Mon Jul 14 21:46:09 2008 -0700
     1.3 @@ -26,6 +26,7 @@
     1.4  		275167DB0DEE2AB000247375 /* Green.png in Resources */ = {isa = PBXBuildFile; fileRef = 275167D60DEE2AB000247375 /* Green.png */; };
     1.5  		275167DC0DEE2AB000247375 /* Red.png in Resources */ = {isa = PBXBuildFile; fileRef = 275167D70DEE2AB000247375 /* Red.png */; };
     1.6  		275167DD0DEE2AB000247375 /* Violet.png in Resources */ = {isa = PBXBuildFile; fileRef = 275167D80DEE2AB000247375 /* Violet.png */; };
     1.7 +		27534A2B0E2C6281006C24A6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27534A2A0E2C6281006C24A6 /* AudioToolbox.framework */; };
     1.8  		276DFC410D00867000D329AE /* Green Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 276DFC400D00867000D329AE /* Green Ball.png */; };
     1.9  		276DFC560D00890C00D329AE /* Red Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 276DFC530D00890C00D329AE /* Red Ball.png */; };
    1.10  		276DFC570D00890C00D329AE /* Yellow Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 276DFC540D00890C00D329AE /* Yellow Ball.png */; };
    1.11 @@ -89,6 +90,7 @@
    1.12  		275167D60DEE2AB000247375 /* Green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Green.png; sourceTree = "<group>"; };
    1.13  		275167D70DEE2AB000247375 /* Red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Red.png; sourceTree = "<group>"; };
    1.14  		275167D80DEE2AB000247375 /* Violet.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Violet.png; sourceTree = "<group>"; };
    1.15 +		27534A2A0E2C6281006C24A6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
    1.16  		276DFC400D00867000D329AE /* Green Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Green Ball.png"; path = "Resources/Green Ball.png"; sourceTree = "<group>"; };
    1.17  		276DFC530D00890C00D329AE /* Red Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Red Ball.png"; path = "Resources/Red Ball.png"; sourceTree = "<group>"; };
    1.18  		276DFC540D00890C00D329AE /* Yellow Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Yellow Ball.png"; path = "Resources/Yellow Ball.png"; sourceTree = "<group>"; };
    1.19 @@ -138,6 +140,7 @@
    1.20  			files = (
    1.21  				8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
    1.22  				27CCA95F0CB8A74D001CFE24 /* Quartz.framework in Frameworks */,
    1.23 +				27534A2B0E2C6281006C24A6 /* AudioToolbox.framework in Frameworks */,
    1.24  			);
    1.25  			runOnlyForDeploymentPostprocessing = 0;
    1.26  		};
    1.27 @@ -183,6 +186,7 @@
    1.28  		1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
    1.29  			isa = PBXGroup;
    1.30  			children = (
    1.31 +				27534A2A0E2C6281006C24A6 /* AudioToolbox.framework */,
    1.32  				29B97324FDCFA39411CA2CEA /* AppKit.framework */,
    1.33  				27CCA95E0CB8A74D001CFE24 /* Quartz.framework */,
    1.34  				29B97325FDCFA39411CA2CEA /* Foundation.framework */,
     2.1 --- a/Source/DemoBoardView.m	Mon Jul 14 21:00:15 2008 -0700
     2.2 +++ b/Source/DemoBoardView.m	Mon Jul 14 21:46:09 2008 -0700
     2.3 @@ -22,6 +22,8 @@
     2.4  */
     2.5  #import "DemoBoardView.h"
     2.6  #import "Game.h"
     2.7 +#import "Turn.h"
     2.8 +#import "Player.h"
     2.9  #import "GGBTextLayer.h"
    2.10  #import "QuartzUtils.h"
    2.11  
    2.12 @@ -39,7 +41,7 @@
    2.13  
    2.14  - (IBAction) toggleRemoteOpponent: (id)sender
    2.15  {
    2.16 -    NSAssert(self.game.currentTurn==0,@"Game has already begun");
    2.17 +    NSAssert(self.game.currentTurnNo==0,@"Game has already begun");
    2.18      Player *opponent = [self.game.players objectAtIndex: 1];
    2.19      opponent.local = !opponent.local;
    2.20  }
    2.21 @@ -94,7 +96,7 @@
    2.22      
    2.23      [self startGameNamed: sCurrentGameName];
    2.24      
    2.25 -    [_turnSlider bind: @"value"    toObject: self withKeyPath: @"game.currentTurn" options: nil];
    2.26 +    [_turnSlider bind: @"value"    toObject: self withKeyPath: @"game.currentTurnNo" options: nil];
    2.27  }
    2.28  
    2.29  
    2.30 @@ -112,12 +114,12 @@
    2.31  {
    2.32      Game *game = self.game;
    2.33      if( object == game ) {
    2.34 -        NSLog(@"maxTurn = %u, currentTurn = %u", 
    2.35 -              self.game.maxTurn,self.game.currentTurn);
    2.36 -        NSLog(@"Game state = '%@'", self.game.stateString);
    2.37 +        NSLog(@"maxTurnNo = %u, currentTurnNo = %u", 
    2.38 +              self.game.maxTurnNo,self.game.currentTurnNo);
    2.39 +        NSLog(@"Game state = '%@'", self.game.currentTurn.boardState);
    2.40  
    2.41 -        _turnSlider.maxValue = self.game.maxTurn;
    2.42 -        _turnSlider.numberOfTickMarks = self.game.maxTurn+1;
    2.43 +        _turnSlider.maxValue = self.game.maxTurnNo;
    2.44 +        _turnSlider.numberOfTickMarks = self.game.maxTurnNo+1;
    2.45          
    2.46          Player *p = game.winner;
    2.47          NSString *msg;
    2.48 @@ -141,7 +143,7 @@
    2.49  - (IBAction) undo: (id)sender
    2.50  {
    2.51      if( self.game.currentTurn > 0 )
    2.52 -        self.game.currentTurn--;
    2.53 +        self.game.currentTurnNo--;
    2.54      else
    2.55          NSBeep();
    2.56  }
    2.57 @@ -149,8 +151,8 @@
    2.58  
    2.59  - (IBAction) redo: (id)sender
    2.60  {
    2.61 -    if( self.game.currentTurn < self.game.maxTurn )
    2.62 -        self.game.currentTurn++;
    2.63 +    if( self.game.currentTurnNo < self.game.maxTurnNo )
    2.64 +        self.game.currentTurnNo++;
    2.65      else
    2.66          NSBeep();
    2.67  }