home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / OPENSTEP / Games / Empire-0.6-MIS / MapView.h < prev    next >
Encoding:
Text File  |  1997-10-30  |  3.7 KB  |  133 lines

  1. //
  2. // $Id: MapView.h,v 1.6 1997/10/31 04:51:52 nygard Exp $
  3. //
  4.  
  5. //
  6. //  This file is a part of Empire, a game of exploration and conquest.
  7. //  Copyright (C) 1996  Steve Nygard
  8. //
  9. //  This program is free software; you can redistribute it and/or modify
  10. //  it under the terms of the GNU General Public License as published by
  11. //  the Free Software Foundation; either version 2 of the License, or
  12. //  (at your option) any later version.
  13. //
  14. //  This program is distributed in the hope that it will be useful,
  15. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. //  GNU General Public License for more details.
  18. //
  19. //  You should have received a copy of the GNU General Public License
  20. //  along with this program; if not, write to the Free Software
  21. //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. //
  23. //  You may contact the author by:
  24. //     e-mail:  nygard@telusplanet.net
  25. //
  26.  
  27. #import <AppKit/AppKit.h>
  28. #import "Empire.h"
  29.  
  30. @class Map;
  31.  
  32. //======================================================================
  33.  
  34. @interface MapView : NSView
  35. {
  36.     Map *map;
  37.     id delegate;
  38.  
  39.     // If enabled, only sends mouse down events when the location has changed.
  40.     BOOL compressEvents;
  41.  
  42.     // Cursor handling:
  43.     BOOL cursorEnabled;
  44.     BOOL cursorOn;
  45.     BOOL fastCursor;
  46.     EMMapLocation cursorLocation;
  47.     NSTimer *cursorTimer;
  48.     NSImage *cursorImage;
  49.  
  50.     Icon cursorIcon;
  51.     Player cursorPlayer;
  52. }
  53.  
  54. + (void) initialize;
  55.  
  56. - initWithFrame:(NSRect)frameRect;
  57. - (void) dealloc;
  58.  
  59. - (BOOL) acceptsFirstResponder;
  60. - (BOOL) acceptsFirstMouse:(NSEvent *)theEvent;
  61.  
  62. - (BOOL) isOpaque;
  63. - (void) drawRect:(NSRect)rect;
  64.  
  65. - (Map *) map;
  66. - (void) setMap:(Map *)aMap;
  67.  
  68.  
  69.  
  70. - (EMMapLocation) getLocationForPoint:(NSPoint)point;
  71. - (NSPoint) getPointForLocation:(EMMapLocation)target;
  72. - (NSPoint) getCenterPointForLocation:(EMMapLocation)target;
  73. - (NSRect) getRectForLocation:(EMMapLocation)target;
  74. - (NSRect) getRectAround3x3Location:(EMMapLocation)target;
  75.  
  76. - (void) centerLocation:(EMMapLocation)target ifNotVisible:(BOOL)notVisibleFlag;
  77. - (void) scrollLocationToVisible:(EMMapLocation)target;
  78.  
  79. - (void) displayLocation:(EMMapLocation)target;
  80. - (void) displayAround3x3Location:(EMMapLocation)target;
  81.  
  82.  
  83.  
  84. - (void) mouseDown:(NSEvent *)theEvent;
  85. - (void) mouseUp:(NSEvent *)theEvent;
  86. - (void) rightMouseDown:(NSEvent *)theEvent;
  87. - (void) rightMouseUp:(NSEvent *)theEvent;
  88. - (void) keyDown:(NSEvent *)theEvent;
  89.  
  90. - (void) enableCompressedEvents:(BOOL)flag;
  91.  
  92. - (void) vendorImagesUpdated:(BOOL)player1:(BOOL)player2:(BOOL)player3:(BOOL)other;
  93. - (void) updateVisiblePlayer:(Player)number;
  94.  
  95. //======================================================================
  96. // Map Observer
  97. //======================================================================
  98.  
  99. - (void) refreshMap;
  100. - (void) refreshLocation:(EMMapLocation)target;
  101. - (void) refresh3x3Location:(EMMapLocation)target;
  102.  
  103. //======================================================================
  104. // Combat report...
  105. //======================================================================
  106.  
  107. - (void) showExplosions:(int)count atLocation:(EMMapLocation)target;
  108.  
  109. //======================================================================
  110. // Cursor Handling
  111. //======================================================================
  112.  
  113. - (void) centerScreenAroundCursor;
  114. - (void) centerCursor;
  115.  
  116. - (BOOL) cursorEnabled;
  117. - (void) setCursorEnabled:(BOOL)flag;
  118. - (void) setFastCursor:(BOOL)flag;
  119.  
  120. - (EMMapLocation) cursorLocation;
  121. - (void) positionCursorAtLocation:(EMMapLocation)target;
  122.  
  123. - (void) setCursor:(Icon)icon player:(Player)aPlayer;
  124. - (void) updateCursorImage;
  125.  
  126. - (void) cursorTimer:(NSTimer *)aTimer;
  127. - (void) updateCursor:(BOOL)scroll;
  128.  
  129. - (void) useDefaultCursor;
  130. - (void) useDirectionCursor;
  131.  
  132. @end
  133.