~ubuntu-branches/ubuntu/karmic/starvoyager/karmic

« back to all changes in this revision

Viewing changes to presence.h

  • Committer: Bazaar Package Importer
  • Author(s): Idan Sofer
  • Date: 2003-08-01 16:55:13 UTC
  • Revision ID: james.westby@ubuntu.com-20030801165513-0ueb129iym99k7tg
Tags: upstream-0.4.4
ImportĀ upstreamĀ versionĀ 0.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        presence.h
 
3
        
 
4
        (c) Richard Thrippleton
 
5
        Licensing terms are in the 'LICENSE' file
 
6
        If that file is not included with this source then permission is not given to use this source in any way whatsoever.
 
7
*/
 
8
 
 
9
struct box;
 
10
struct icord;
 
11
struct ivect;
 
12
class graphic;
 
13
 
 
14
class presence //Client side view of the universe and its simple objects
 
15
{
 
16
        public:
 
17
        enum {ISIZE=2048}; //Size of presence object index
 
18
        static void init(); //Initialise the presence system datastructures
 
19
        static void purgeall(); //Purge all presence data after use
 
20
        static void feed(unsigned char* buf); //Update/create a presence from a buffer
 
21
        static void interpolateall(); //Run interpolation on all the presence objects
 
22
        static presence* get(int indx); //Return the presence object of given index
 
23
        static void render(); //Render client/presence info, such as realtime information indicators
 
24
        static void controls(); //Run the in game ship controls
 
25
 
 
26
        void drawat(int sx,short sy,short zout); //Draw at the given screen location with the given zoom-out scaling
 
27
 
 
28
        static presence* me; //Presence played by this client
 
29
        static presence* trg; //Personal target
 
30
        static presence* hl; //Hilight target
 
31
        static int hul,pow,shd,ful; //Hull, power, shield and fuel percentages
 
32
        static ipol vel; //Velocity of self
 
33
        static long srng,lrng; //Sensor range and long range
 
34
 
 
35
        int self; //Presence object self index
 
36
        int typ; //Object type
 
37
        char nam[65]; //Name of object
 
38
        char anno[65]; //Annotative data, e.g. alliance
 
39
        icord loc; //Location
 
40
        ivect mov; //Motion vector
 
41
        bool enem; //Is enemy?
 
42
 
 
43
        private:
 
44
        presence(int self,unsigned char* buf); //Create a new object with a given network buffer input and given self index
 
45
        ~presence(); //Delete this presence object
 
46
 
 
47
        static presence* gettarget(int typ,short dir,box cov,bool out,bool enem); //Flip through targets of given type, flicking either forwards or backwards(dir -1 or +1) through them, within the given bounding box, out refers to outside the box or not, enem if you want hostiles only
 
48
        static void updself(unsigned char* buf); //Update self data with given buffer
 
49
 
 
50
        void name(unsigned char* buf); //Name the object with given network buffer
 
51
        void update(unsigned char* buf);  //Update an object with given buffer
 
52
        void interpolate(); //Run motion interpolation on this presence
 
53
 
 
54
        static presence* objs[ISIZE]; //Index of presence objects
 
55
        static int hltm; //Hilight time remaining
 
56
 
 
57
        graphic* spr; //Sprite
 
58
        int col; //Colour (makes it a beam)
 
59
        int vis; //Visibility percentage (for cloaking stuff)
 
60
        int ang; //Angle of orientation
 
61
        int age; //Age of presence object
 
62
        presence* link; //Link to another presence, for example owner of a frag
 
63
};