# HG changeset patch # User Jens Alfke # Date 1216097169 25200 # Node ID ccc5ed68222d79f09e2c12c22fe2fa808e5e3fba # Parent 28392c9a969fef860c11153a50dfb03236cb75de Updated DemoBoardView and the xcode project to work with the latest sources. diff -r 28392c9a969f -r ccc5ed68222d GeekGameBoard.xcodeproj/project.pbxproj --- a/GeekGameBoard.xcodeproj/project.pbxproj Mon Jul 14 21:00:15 2008 -0700 +++ b/GeekGameBoard.xcodeproj/project.pbxproj Mon Jul 14 21:46:09 2008 -0700 @@ -26,6 +26,7 @@ 275167DB0DEE2AB000247375 /* Green.png in Resources */ = {isa = PBXBuildFile; fileRef = 275167D60DEE2AB000247375 /* Green.png */; }; 275167DC0DEE2AB000247375 /* Red.png in Resources */ = {isa = PBXBuildFile; fileRef = 275167D70DEE2AB000247375 /* Red.png */; }; 275167DD0DEE2AB000247375 /* Violet.png in Resources */ = {isa = PBXBuildFile; fileRef = 275167D80DEE2AB000247375 /* Violet.png */; }; + 27534A2B0E2C6281006C24A6 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27534A2A0E2C6281006C24A6 /* AudioToolbox.framework */; }; 276DFC410D00867000D329AE /* Green Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 276DFC400D00867000D329AE /* Green Ball.png */; }; 276DFC560D00890C00D329AE /* Red Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 276DFC530D00890C00D329AE /* Red Ball.png */; }; 276DFC570D00890C00D329AE /* Yellow Ball.png in Resources */ = {isa = PBXBuildFile; fileRef = 276DFC540D00890C00D329AE /* Yellow Ball.png */; }; @@ -89,6 +90,7 @@ 275167D60DEE2AB000247375 /* Green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Green.png; sourceTree = ""; }; 275167D70DEE2AB000247375 /* Red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Red.png; sourceTree = ""; }; 275167D80DEE2AB000247375 /* Violet.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Violet.png; sourceTree = ""; }; + 27534A2A0E2C6281006C24A6 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 276DFC400D00867000D329AE /* Green Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Green Ball.png"; path = "Resources/Green Ball.png"; sourceTree = ""; }; 276DFC530D00890C00D329AE /* Red Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Red Ball.png"; path = "Resources/Red Ball.png"; sourceTree = ""; }; 276DFC540D00890C00D329AE /* Yellow Ball.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Yellow Ball.png"; path = "Resources/Yellow Ball.png"; sourceTree = ""; }; @@ -138,6 +140,7 @@ files = ( 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 27CCA95F0CB8A74D001CFE24 /* Quartz.framework in Frameworks */, + 27534A2B0E2C6281006C24A6 /* AudioToolbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -183,6 +186,7 @@ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( + 27534A2A0E2C6281006C24A6 /* AudioToolbox.framework */, 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 27CCA95E0CB8A74D001CFE24 /* Quartz.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, diff -r 28392c9a969f -r ccc5ed68222d Source/DemoBoardView.m --- a/Source/DemoBoardView.m Mon Jul 14 21:00:15 2008 -0700 +++ b/Source/DemoBoardView.m Mon Jul 14 21:46:09 2008 -0700 @@ -22,6 +22,8 @@ */ #import "DemoBoardView.h" #import "Game.h" +#import "Turn.h" +#import "Player.h" #import "GGBTextLayer.h" #import "QuartzUtils.h" @@ -39,7 +41,7 @@ - (IBAction) toggleRemoteOpponent: (id)sender { - NSAssert(self.game.currentTurn==0,@"Game has already begun"); + NSAssert(self.game.currentTurnNo==0,@"Game has already begun"); Player *opponent = [self.game.players objectAtIndex: 1]; opponent.local = !opponent.local; } @@ -94,7 +96,7 @@ [self startGameNamed: sCurrentGameName]; - [_turnSlider bind: @"value" toObject: self withKeyPath: @"game.currentTurn" options: nil]; + [_turnSlider bind: @"value" toObject: self withKeyPath: @"game.currentTurnNo" options: nil]; } @@ -112,12 +114,12 @@ { Game *game = self.game; if( object == game ) { - NSLog(@"maxTurn = %u, currentTurn = %u", - self.game.maxTurn,self.game.currentTurn); - NSLog(@"Game state = '%@'", self.game.stateString); + NSLog(@"maxTurnNo = %u, currentTurnNo = %u", + self.game.maxTurnNo,self.game.currentTurnNo); + NSLog(@"Game state = '%@'", self.game.currentTurn.boardState); - _turnSlider.maxValue = self.game.maxTurn; - _turnSlider.numberOfTickMarks = self.game.maxTurn+1; + _turnSlider.maxValue = self.game.maxTurnNo; + _turnSlider.numberOfTickMarks = self.game.maxTurnNo+1; Player *p = game.winner; NSString *msg; @@ -141,7 +143,7 @@ - (IBAction) undo: (id)sender { if( self.game.currentTurn > 0 ) - self.game.currentTurn--; + self.game.currentTurnNo--; else NSBeep(); } @@ -149,8 +151,8 @@ - (IBAction) redo: (id)sender { - if( self.game.currentTurn < self.game.maxTurn ) - self.game.currentTurn++; + if( self.game.currentTurnNo < self.game.maxTurnNo ) + self.game.currentTurnNo++; else NSBeep(); }