jens@1: // jens@1: // BoardUIView.h jens@1: // GeekGameBoard jens@1: // jens@1: // Created by Jens Alfke on 3/7/08. jens@1: // Copyright 2008 __MyCompanyName__. All rights reserved. jens@1: // jens@1: jens@1: #import jens@1: @class GGBLayer, Bit, Card, Grid, Game; jens@1: @protocol BitHolder; jens@1: jens@1: jens@1: /** NSView that hosts a game. */ jens@1: @interface BoardUIView : UIView jens@1: { jens@1: @private jens@1: Game *_game; // Current Game jens@1: GGBLayer *_gameboard; // Game's main layer jens@1: jens@1: // Used during mouse-down tracking: jens@1: CGPoint _dragStartPos; // Starting position of mouseDown jens@1: Bit *_dragBit; // Bit being dragged jens@1: id _oldHolder; // Bit's original holder jens@1: CALayer *_oldSuperlayer; // Bit's original superlayer jens@1: int _oldLayerIndex; // Bit's original index in _oldSuperlayer.layers jens@1: CGPoint _oldPos; // Bit's original x/y position jens@1: CGPoint _dragOffset; // Offset of mouse position from _dragBit's origin jens@1: BOOL _dragMoved; // Has the mouse moved more than 3 pixels since mouseDown? jens@1: id _dropTarget; // Current BitHolder the cursor is over jens@1: jens@1: // Used while handling incoming drags: jens@1: GGBLayer *_viewDropTarget; // Current drop target during an incoming drag-n-drop jens@1: } jens@1: jens@1: - (void) startGameNamed: (NSString*)gameClassName; jens@1: jens@1: @property (readonly) Game *game; jens@1: @property (readonly) GGBLayer *gameboard; jens@1: jens@1: - (CGRect) gameBoardFrame; jens@1: jens@1: @end