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

  1. //
  2. // $Id: EditorController.h,v 1.9 1997/10/23 02:25:36 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.  
  29. #import "Empire.h"
  30. #import "EmpireProtocols.h" // For MapViewDelegate, which should be replaced by NSNotificationCenter stuff.
  31.  
  32. typedef enum _SaveMode
  33. {
  34.     sm_save,
  35.     sm_save_as,
  36.     sm_save_to
  37. } SaveMode;
  38.  
  39. @class Map;
  40. @class MapView;
  41. @class SNRandom;
  42. @class WorldMapController;
  43.  
  44. @interface EditorController : NSObject <MapViewDelegate>
  45. {
  46.     IBOutlet NSWindow *mapEditorWindow;
  47.     IBOutlet NSWindow *newMapPanel;
  48.     IBOutlet MapView *mapView;
  49.     WorldMapController *worldMapController;
  50.  
  51.     IBOutlet NSTextField *widthTextfield;
  52.     IBOutlet NSTextField *heightTextfield;
  53.  
  54.     Map *map;
  55.     NSString *mapName;
  56.  
  57.     int brushType;
  58.     MapToken tokenType;
  59.  
  60.     IBOutlet NSTextField *islandCountTextfield;
  61.     IBOutlet NSTextField *minimumSizeTextfield;
  62.     IBOutlet NSTextField *maximumSizeTextfield;
  63.     IBOutlet NSTextField *buildTypeMatrix;
  64.  
  65.     IBOutlet NSTableView *terrainSummaryTableview;
  66.  
  67.     int terrainCounts[4];
  68.  
  69.     NSString *lastDirectory;
  70.     SNRandom *rng;
  71. }
  72.  
  73. - (void) awakeFromNib;
  74. - init;
  75. - (void) dealloc;
  76.  
  77. - (Map *) map;
  78. - (void) setMap:(Map *)newMap;
  79.  
  80. - (void) takeBrushTypeFrom:sender;
  81. - (void) takeTokenTypeFrom:sender;
  82.  
  83. - (BOOL) validateMenuItem:(NSMenuItem *)menuCell;
  84.  
  85. - (void) showWorldMap:sender;
  86. - (void) newMapStopAction:sender;
  87. - (void) okayAction:sender;
  88.  
  89. - (void) takeLastDirectoryFromSavePanel:(NSSavePanel *)savePanel;
  90.  
  91. - (void) newMap;
  92.  
  93. - (void) open:sender;
  94. - (void) save:sender;
  95. - (void) saveAs:sender;
  96. - (void) saveTo:sender;
  97. - (BOOL) saveMode:(SaveMode)sm;
  98.  
  99. - (void) growTerrain:(MapToken)token fromLocation:(EMMapLocation)source toLocation:(EMMapLocation)target;
  100. - (void) branchTerrain:(MapToken)token fromLocation:(EMMapLocation)source toLocation:(EMMapLocation)target;
  101.  
  102. - (void) growTerrain:(MapToken)token fromLocation:(EMMapLocation)source;
  103. - (void) branchTerrain:(MapToken)token fromLocation:(EMMapLocation)source;
  104.  
  105. - (BOOL) location:(EMMapLocation)target adjacentToTerrain:(Terrain)terrain;
  106.  
  107. - (void) clearToCurrent:sender;
  108.  
  109. - (void) suspendMainMapUpdate;
  110. - (void) resumeMainMapUpdate;
  111.  
  112. //======================================================================
  113. // Build World
  114. //======================================================================
  115.  
  116. - (void) recalculateTerrainDistribution:sender;
  117. - (void) build:sender;
  118.  
  119. - (void) clearSingleTerrains:sender;
  120. - (EMMapLocation) meanderFromLocation:(EMMapLocation)location
  121.                    lastDirectionIndex:(int *)lastIndex
  122.                                origin:(EMMapLocation)origin
  123.                                  size:(EMMapSize)size;
  124. - (EMMapLocation) meanderFromLocation:(EMMapLocation)location lastDirectionIndex:(int *)lastIndex;
  125. - (void) meander:sender;
  126.  
  127. - (int) numberOfRowsInTableView:(NSTableView *)aTableView;
  128. - tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
  129.  
  130. //======================================================================
  131. // MapViewDelegate
  132. //======================================================================
  133.  
  134. - (void) mouseDown:(unsigned int)modifierFlags atLocation:(EMMapLocation)target;
  135. - (void) mouseUp:(unsigned int)modifierFlags atLocation:(EMMapLocation)target;
  136. - (void) rightMouseDown:(unsigned int)modifierFlags atLocation:(EMMapLocation)target;
  137. - (void) rightMouseUp:(unsigned int)modifierFlags atLocation:(EMMapLocation)target;
  138. - (void) keyDown:(NSEvent *)theEvent;
  139.  
  140. //======================================================================
  141. // WindowDelegate
  142. //======================================================================
  143.  
  144. - (void) windowDidBecomeKey:(NSNotification *)notification;
  145. - (void) windowDidResignKey:(NSNotification *)notification;
  146.   
  147. - (void) windowWillMiniaturize:(NSNotification *)notification;
  148. - (void) windowDidDeminiaturize:(NSNotification *)notification;
  149.  
  150. @end
  151.