00001
00002
00003
00004
00005
00006
00007
00008
00009 #import <Cocoa/Cocoa.h>
00010 #import "Data.h"
00011
00012 #define UNIVERSE_SCALE 40
00013 #define UNIVERSE_MAX_PLANETS 40
00014
00015
00016 #define UNIVERSE_MAX_PLAYERS 32
00017 #define UNIVERSE_MAX_TORPS 8
00018
00019 #define UNIVERSE_PIXEL_SIZE 100000
00020 #define UNIVERSE_HALF_PIXEL_SIZE (PIXEL_SIZE / 2)
00021
00022 #define UNIVERSE_TARG_PLAYER 0x01
00023 #define UNIVERSE_TARG_PLANET 0x02
00024 #define UNIVERSE_TARG_CLOAK 0x04
00025 #define UNIVERSE_TARG_SELF 0x08
00026 #define UNIVERSE_TARG_ENEMY 0x10
00027 #define UNIVERSE_TARG_FRIEND 0x20
00028 #define UNIVERSE_TARG_BASE 0x40
00029
00030 @interface Universe : NSObject {
00031 NSMutableArray *players;
00032 NSMutableArray *teams;
00033 NSMutableArray *shipTypes;
00034 NSMutableArray *torps;
00035 NSMutableArray *plasmas;
00036 NSMutableArray *phasers;
00037 NSMutableArray *planets;
00038 Status *status;
00039 }
00040
00041 + (Universe*) defaultInstance;
00042
00043 -(NSLock *)synchronizeAccess;
00044 -(int)remappedTeamIdWithId:(int)teamId;
00045 - (Rank *) rankWithId:(int)rankId;
00046 - (bool) entity:(Entity*)obj1 closerToPos:(NSPoint)pos than:(Entity*)obj2;
00047 - (bool) entity:(Entity*)obj1 closerToPlayer:(Player*)player than:(Entity*)obj2;
00048 - (bool) entity:(Entity*)obj1 closerToMeThan:(Entity*)obj2;
00049 - (int) distanceToEntity:(Entity*)obj1 from:(Entity*)obj2;
00050 - (float)angleDegBetween:(NSPoint)p1 andPoint:(NSPoint)p2;
00051 - (float)angleDegBetweenEntity:(Entity*)obj1 from:(Entity*)obj2;
00052 - (Planet *) planetNearPosition:(NSPoint) pos;
00053 - (Planet *) planetNearPlayer:(Player *) player;
00054 - (Planet *) planetNearMe;
00055 - (Player *) playerNearPosition:(NSPoint) pos ofType:(int) type;
00056 - (Player *) playerNearPlayer:(Player *) player ofType:(int) type;
00057 - (Player *) playerNearMeOfType:(int) type;
00058 - (Player *) playerWithId:(int)playerId;
00059 - (int) playerCount;
00060 - (Player *) playerThatIsMe;
00061 - (Planet *) planetWithId:(int)planetId;
00062 - (Ship *) shipOfType:(int)shipType;
00063 - (Ship *) shipWithPhaserId:(int)phaserId;
00064 - (Status *) status;
00065 - (Team *) teamWithId:(int)teamId;
00066 - (Torp *) torpWithId:(int)torpId;
00067 - (Plasma *) plasmaWithId:(int)plasmaId;
00068 - (Phaser *) phaserWithId:(int)phaserId;
00069 - (void) movePlayer:(Player *)player toTeam: (Team *)team;
00070 - (void) movePlanet:(Planet *)planet toTeam: (Team *)team;
00071 - (void) setAllTorpsStatus:(int) newStatus;
00072 - (void) setAllPlasmasStatus:(int) newStatus;
00073 - (void) setAllPhasersStatus:(int) newStatus;
00074 - (void) resetWeaponInfo;
00075
00076
00077 @end