Source/BoardUIView.h
author snej@snej.local
Sun Jan 11 00:02:27 2009 -0800 (2009-01-11)
changeset 26 e7a464fb6d39
permissions -rw-r--r--
Added ball graphics to Xcode project, which fixes the Go game. Fixed Tic-Tac-Toe. Fixed an exception in the demo app when changing games.
     1 //
     2 //  BoardUIView.h
     3 //  GeekGameBoard
     4 //
     5 //  Created by Jens Alfke on 3/7/08.
     6 //  Copyright 2008 __MyCompanyName__. All rights reserved.
     7 //
     8 
     9 #import <UIKit/UIKit.h>
    10 @class GGBLayer, Bit, Card, Grid, Game;
    11 @protocol BitHolder;
    12 
    13 
    14 /** NSView that hosts a game. */
    15 @interface BoardUIView : UIView
    16 {
    17     @private
    18     Game *_game;                                // Current Game
    19     GGBLayer *_gameboard;                       // Game's main layer
    20     
    21     // Used during mouse-down tracking:
    22     CGPoint _dragStartPos;                      // Starting position of mouseDown
    23     Bit *_dragBit;                              // Bit being dragged
    24     id<BitHolder> _oldHolder;                   // Bit's original holder
    25     CALayer *_oldSuperlayer;                    // Bit's original superlayer
    26     int _oldLayerIndex;                         // Bit's original index in _oldSuperlayer.layers
    27     CGPoint _oldPos;                            // Bit's original x/y position
    28     CGPoint _dragOffset;                        // Offset of mouse position from _dragBit's origin
    29     BOOL _dragMoved;                            // Has the mouse moved more than 3 pixels since mouseDown?
    30     id<BitHolder> _dropTarget;                  // Current BitHolder the cursor is over
    31     
    32     // Used while handling incoming drags:
    33     GGBLayer *_viewDropTarget;                   // Current drop target during an incoming drag-n-drop
    34 }
    35 
    36 - (void) startGameNamed: (NSString*)gameClassName;
    37 
    38 @property (readonly) Game *game;
    39 @property (readonly) GGBLayer *gameboard;
    40 
    41 - (CGRect) gameBoardFrame;
    42 
    43 @end