Source/TicTacToeGame.m
changeset 27 b0affce7beb1
parent 16 28392c9a969f
     1.1 --- a/Source/TicTacToeGame.m	Mon Jul 14 21:00:15 2008 -0700
     1.2 +++ b/Source/TicTacToeGame.m	Tue Mar 10 22:36:23 2009 -0700
     1.3 @@ -58,23 +58,6 @@
     1.4      _grid.cellColor = CreateGray(1.0, 0.25);
     1.5      _grid.lineColor = kTranslucentLightGrayColor;
     1.6      [_table addSublayer: _grid];
     1.7 -    
     1.8 -    // Create piece dispensers for the two players:
     1.9 -    for( int playerNumber=0; playerNumber<=1; playerNumber++ ) {
    1.10 -        Piece *p = [self pieceForPlayer: playerNumber];
    1.11 -        CGFloat x = floor(CGRectGetMidX(_table.bounds));
    1.12 -#if TARGET_OS_IPHONE
    1.13 -        x = x - 80 + 160*playerNumber;
    1.14 -        CGFloat y = 360;
    1.15 -#else
    1.16 -        x += (playerNumber==0 ?-230 :230);
    1.17 -        CGFloat y = 175;
    1.18 -#endif
    1.19 -        [_dispenser[playerNumber] release];
    1.20 -        _dispenser[playerNumber] = [[Dispenser alloc] initWithPrototype: p quantity: 0
    1.21 -                                                                  frame: CGRectMake(x-45,y-45, 90,90)];
    1.22 -        [_table addSublayer: _dispenser[playerNumber]];
    1.23 -    }            
    1.24  }
    1.25  
    1.26  
    1.27 @@ -109,7 +92,7 @@
    1.28  - (Bit*) bitToPlaceInHolder: (id<BitHolder>)holder
    1.29  {
    1.30      if( holder.bit==nil && [holder isKindOfClass: [Square class]] )
    1.31 -        return _dispenser[self.currentPlayer.index].bit;
    1.32 +        return [self pieceForPlayer: self.currentPlayer.index];
    1.33      else
    1.34          return nil;
    1.35  }
    1.36 @@ -123,15 +106,6 @@
    1.37      [super bit: bit movedFrom: src to: dst];
    1.38  }
    1.39  
    1.40 -/* FIX: Need to restore this somehow, now that -nextPlayer is gone
    1.41 -- (void) nextPlayer
    1.42 -{
    1.43 -    [super nextPlayer];
    1.44 -    // Give the next player another piece to put down:
    1.45 -    _dispenser[self.currentPlayer.index].quantity = 1;
    1.46 -}
    1.47 - */
    1.48 -
    1.49  static Player* ownerAt( Grid *grid, int index )
    1.50  {
    1.51      return [grid cellAtRow: index/3 column: index%3].bit.owner;