/Volumes/Plantain/MyDocuments/Projects/MacTrek/MacTrek/Painter/PainterFactory.h

00001 //
00002 //  PainterFactory.h
00003 //  MacTrek
00004 //
00005 //  Created by Aqua on 19/06/2006.
00006 //  Copyright 2006 __MyCompanyName__. All rights reserved.
00007 //
00008 
00009 #import <Cocoa/Cocoa.h>
00010 #import "Data.h"
00011 #import "Phaser.h"
00012 #import "BaseClass.h"
00013 #import "Luky.h"
00014 #import "Math.h"
00015 #include <unistd.h>
00016 #include <stdlib.h>
00017 
00018 
00019 #define PF_DEFAULT_BACKGROUND_IMAGE_SIZE NSMakeSize(100, 100)
00020 #define PF_ALERT_BORDER_WIDTH 2
00021 #define PF_TRIANGLE_WIDTH   800.0
00022 #define PF_TRIANGLE_HEIGHT  400.0
00023 
00024 @interface PainterFactory : BaseClass {
00025     Universe *universe;
00026     bool debugLabels;
00027     bool simple; // used for an overview map, omits torps, shields etc.
00028 }
00029 
00030 // internal
00031 - (void) setSimplifyDrawing:(bool)simpleDraw;
00032 - (void) setDebugLabels:(bool)debug;
00033 - (bool) debugLabels;
00034 - (void) cacheImagesInSeperateThread:(id)sender;
00035 
00036 // helper
00037 - (NSRect) rectWithHeight:(int)height width:(int)width centerPoint:(NSPoint)centerGravity;
00038 - (NSPoint) centreOfRect:(NSRect)aRect;
00039 
00040 // conversions
00041 - (NSPoint) viewPointFromGamePoint:(NSPoint)point viewRect:(NSRect)bounds 
00042              gamePosInCentreOfView:(NSPoint)centrePos withScale:(int)scale;
00043 - (NSPoint) gamePointFromViewPoint:(NSPoint)point viewRect:(NSRect)bounds 
00044              gamePosInCentreOfView:(NSPoint)centrePos withScale:(int)scale;
00045 - (NSSize)  gameSizeFromViewSize:(NSSize)rect withScale:(int)scale;
00046 - (NSSize)  viewSizeFromGameSize:(NSSize)rect withScale:(int)scale;
00047 
00048 // information
00049 - (NSRect) gameRectAround:(NSPoint)gamePoint forView:(NSRect)bounds withScale:(int)scale;
00050 
00051 // draw routines
00052 - (void) drawRect:(NSRect)drawingBounds ofViewBounds:(NSRect)viewBounds whichRepresentsGameBounds:(NSRect)gameBounds 
00053         withScale:(int)scale;
00054 - (void) drawAlertBorder:(NSRect) bounds forMe:(Player *)me;
00055 - (void) drawBackgroundInRect:(NSRect) drawingBounds ofViewBounds:(NSRect)viewBounds forMe:(Player*) me ;
00056 - (void) drawGalaxyEdgesInRect:(NSRect) drawingBounds forGameRect:(NSRect)gameBounds ofViewBounds:(NSRect)viewBounds withScale:(int)scale;
00057 - (void) drawPlanetsInRect:(NSRect)drawingBounds forGameRect:(NSRect)gameBounds ofViewBounds:(NSRect)viewBounds withScale:(int)scale;
00058 - (void) drawPlayersInRect:(NSRect)drawingBounds forGameRect:(NSRect)gameBounds ofViewBounds:(NSRect)viewBounds  withScale:(int)scale;
00059 - (void) drawTorpsInRect:(NSRect)drawingBounds forGameRect:(NSRect)gameBounds ofViewBounds:(NSRect)viewBounds  withScale:(int)scale ;
00060 - (void) drawPlasmasInRect:(NSRect)drawingBounds forGameRect:(NSRect)gameBounds ofViewBounds:(NSRect)viewBounds  withScale:(int)scale;
00061 - (void)drawLockInRect:(NSRect)drawingBounds forGameRect:(NSRect)gameBounds ofViewBounds:(NSRect)viewBounds withScale:(int)scale ;
00062 - (void) rotateAndDrawPlayer:(Player*) player inRect:(NSRect) Rect;
00063 
00064 // should be overwritten by subclasses
00065 - (void)   drawPlayer:(Player*) player inRect:(NSRect) Rect;
00066 - (void)   drawShieldWithStrenght: (float)shieldPercentage inRect:(NSRect) Rect;
00067 - (void)   drawLabelForPlanet:(Planet*)planets belowRect:(NSRect)planetViewBounds;
00068 - (void)   drawLabelForPlayer:(Player*)player belowRect:(NSRect)playerViewBounds;
00069 - (void)   drawPlanet:(Planet*) planet inRect:(NSRect) Rect;
00070 - (void)   drawTorp:(Torp*) torp       inRect:(NSRect) Rect;
00071 - (void)   drawPlasma:(Plasma*) plasma inRect:(NSRect) Rect;
00072 - (void)   drawBackgroundImageInRect:(NSRect) Rect;
00073 
00074 //  could be overwritten to match the size of the subclasses artwork
00075 //
00076 // and the stamping algorithm (will use defaults otherwise)
00077 - (NSSize) backGroundImageSize;
00078 // could be overwritten if you want different colors
00079 - (NSColor*) colorForTeam:(Team*)team;
00080 // overrule in subclass to cache the images
00081 - (void) cacheImages;
00082 // interesting zoom sizes
00083 - (int) maxScale;
00084 - (int) minScale;
00085 
00086 
00087 @end

Generated on Fri Jul 28 19:15:23 2006 for MacTrek by  doxygen 1.4.7