00001
00002
00003
00004
00005
00006
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;
00028 }
00029
00030
00031 - (void) setSimplifyDrawing:(bool)simpleDraw;
00032 - (void) setDebugLabels:(bool)debug;
00033 - (bool) debugLabels;
00034 - (void) cacheImagesInSeperateThread:(id)sender;
00035
00036
00037 - (NSRect) rectWithHeight:(int)height width:(int)width centerPoint:(NSPoint)centerGravity;
00038 - (NSPoint) centreOfRect:(NSRect)aRect;
00039
00040
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
00049 - (NSRect) gameRectAround:(NSPoint)gamePoint forView:(NSRect)bounds withScale:(int)scale;
00050
00051
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
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
00075
00076
00077 - (NSSize) backGroundImageSize;
00078
00079 - (NSColor*) colorForTeam:(Team*)team;
00080
00081 - (void) cacheImages;
00082
00083 - (int) maxScale;
00084 - (int) minScale;
00085
00086
00087 @end