Source/BoardUIView.h
changeset 8 45c82a071aca
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Source/BoardUIView.h	Wed May 28 12:47:10 2008 -0700
     1.3 @@ -0,0 +1,43 @@
     1.4 +//
     1.5 +//  BoardUIView.h
     1.6 +//  GeekGameBoard
     1.7 +//
     1.8 +//  Created by Jens Alfke on 3/7/08.
     1.9 +//  Copyright 2008 __MyCompanyName__. All rights reserved.
    1.10 +//
    1.11 +
    1.12 +#import <UIKit/UIKit.h>
    1.13 +@class GGBLayer, Bit, Card, Grid, Game;
    1.14 +@protocol BitHolder;
    1.15 +
    1.16 +
    1.17 +/** NSView that hosts a game. */
    1.18 +@interface BoardUIView : UIView
    1.19 +{
    1.20 +    @private
    1.21 +    Game *_game;                                // Current Game
    1.22 +    GGBLayer *_gameboard;                       // Game's main layer
    1.23 +    
    1.24 +    // Used during mouse-down tracking:
    1.25 +    CGPoint _dragStartPos;                      // Starting position of mouseDown
    1.26 +    Bit *_dragBit;                              // Bit being dragged
    1.27 +    id<BitHolder> _oldHolder;                   // Bit's original holder
    1.28 +    CALayer *_oldSuperlayer;                    // Bit's original superlayer
    1.29 +    int _oldLayerIndex;                         // Bit's original index in _oldSuperlayer.layers
    1.30 +    CGPoint _oldPos;                            // Bit's original x/y position
    1.31 +    CGPoint _dragOffset;                        // Offset of mouse position from _dragBit's origin
    1.32 +    BOOL _dragMoved;                            // Has the mouse moved more than 3 pixels since mouseDown?
    1.33 +    id<BitHolder> _dropTarget;                  // Current BitHolder the cursor is over
    1.34 +    
    1.35 +    // Used while handling incoming drags:
    1.36 +    GGBLayer *_viewDropTarget;                   // Current drop target during an incoming drag-n-drop
    1.37 +}
    1.38 +
    1.39 +- (void) startGameNamed: (NSString*)gameClassName;
    1.40 +
    1.41 +@property (readonly) Game *game;
    1.42 +@property (readonly) GGBLayer *gameboard;
    1.43 +
    1.44 +- (CGRect) gameBoardFrame;
    1.45 +
    1.46 +@end