Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gamemode_client.hpp
Go to the documentation of this file.
1 #pragma once
6 #include "inexor/fpsgame/ai.hpp"
7 
10 
12 
14 
15 namespace game {
16 
18 extern float calcradarscale();
19 extern void drawminimap(fpsent *d, float x, float y, float s);
20 extern void setradartex();
21 extern void drawradar(float x, float y, float s);
22 extern void drawteammates(fpsent *d, float x, float y, float s);
23 extern void setbliptex(int team, const char *type = "");
24 
25 struct clientmode
26 {
27  virtual ~clientmode() {}
28 
29  virtual void preload() {}
30  virtual int clipconsole(int w, int h) { return 0; }
31  virtual void drawhud(fpsent *d, int w, int h) {}
32  virtual bool isinvisible(fpsent *d) { return false; }
33  virtual void rendergame() {}
34  virtual void respawned(fpsent *d) {}
35  virtual void setup() {}
36  virtual void checkitems(fpsent *d) {}
37  virtual int respawnwait(fpsent *d) { return 0; }
38  virtual void pickspawn(fpsent *d) { findplayerspawn(d); }
39  virtual void senditems(packetbuf &p) {}
40  virtual void addplayer(fpsent *d) {}
41  virtual void removeplayer(fpsent *d) {}
42  virtual void gameover() {}
43  virtual bool hidefrags() { return false; }
44  virtual int getteamscore(const char *team) { return 0; }
46  virtual void aifind(fpsent *d, ai::aistate &b, vector<ai::interest> &interests) {}
47  virtual bool aicheck(fpsent *d, ai::aistate &b) { return false; }
48  virtual bool aidefend(fpsent *d, ai::aistate &b) { return false; }
49  virtual bool aipursue(fpsent *d, ai::aistate &b) { return false; }
50  virtual void killed(fpsent *d, fpsent *actor) {}
51  virtual void gameconnect(fpsent *d) {}
52  virtual void renderscoreboard(g3d_gui &g, scoregroup &sg, int fgcolor, int bgcolor) {}
55  virtual bool parse_network_message(int type, ucharbuf &p) = 0;
56 };
57 
58 extern clientmode *cmode;
59 extern void setclientmode();
60 
61 } // ns game
Vector template.
Definition: cube_vector.hpp:22
vector< savedscore > scores
Definition: client_management.cpp:367
Definition: gamemode_client.hpp:25
virtual int respawnwait(fpsent *d)
Definition: gamemode_client.hpp:37
virtual bool isinvisible(fpsent *d)
Definition: gamemode_client.hpp:32
void setbliptex(int team, const char *type="")
set specific textures for teammates, skulls... on the minimap
Definition: client.cpp:159
template implementation of buffers (networking e.g.).
Definition: buffer_types.hpp:14
virtual bool parse_network_message(int type, ucharbuf &p)=0
Parse game mode specific network messages.
clientmode * cmode
gamemodes
Definition: client.cpp:205
virtual bool aicheck(fpsent *d, ai::aistate &b)
Definition: gamemode_client.hpp:47
virtual void preload()
Definition: gamemode_client.hpp:29
virtual bool aipursue(fpsent *d, ai::aistate &b)
Definition: gamemode_client.hpp:49
virtual void removeplayer(fpsent *d)
Definition: gamemode_client.hpp:41
virtual void getteamscores(vector< teamscore > &scores)
Definition: gamemode_client.hpp:45
SharedVar< float > minimapalpha
virtual ~clientmode()
Definition: gamemode_client.hpp:27
virtual void checkitems(fpsent *d)
Definition: gamemode_client.hpp:36
virtual void rendergame()
Definition: gamemode_client.hpp:33
virtual bool hidefrags()
Definition: gamemode_client.hpp:43
virtual void respawned(fpsent *d)
Definition: gamemode_client.hpp:34
Definition: ai.hpp:174
void setclientmode()
set game mode pointer
Definition: client.cpp:213
Definition: 3dgui.hpp:52
virtual bool aidefend(fpsent *d, ai::aistate &b)
Definition: gamemode_client.hpp:48
virtual void drawhud(fpsent *d, int w, int h)
Definition: gamemode_client.hpp:31
virtual void setup()
Definition: gamemode_client.hpp:35
float calcradarscale()
calculate required radar scale
Definition: client.cpp:93
virtual void addplayer(fpsent *d)
Definition: gamemode_client.hpp:40
virtual void renderscoreboard(g3d_gui &g, scoregroup &sg, int fgcolor, int bgcolor)
Definition: gamemode_client.hpp:52
virtual void gameconnect(fpsent *d)
Definition: gamemode_client.hpp:51
virtual void gameover()
Definition: gamemode_client.hpp:42
virtual int getteamscore(const char *team)
Definition: gamemode_client.hpp:44
void findplayerspawn(dynent *d, int forceent, int tag)
Definition: world.cpp:1234
int d
Definition: octaedit.cpp:1749
virtual void pickspawn(fpsent *d)
Definition: gamemode_client.hpp:38
network packet buffer
Definition: buffer_types.hpp:132
void drawminimap(fpsent *d, float x, float y, float s)
draw rotated minimap
Definition: client.cpp:100
void drawradar(float x, float y, float s)
draw radar (a trangle square with matching texture coordinates to be precise) to target coordinates ...
Definition: client.cpp:127
Definition: fpsent.hpp:12
SharedVar wrapper for primitive/immutable objects.
Definition: SharedVar.hpp:55
void drawteammates(fpsent *d, float x, float y, float s)
draw all teamate arrow icons in minimap
Definition: client.cpp:165
Used only for the scoreboard.
Definition: teaminfo.hpp:80
virtual void senditems(packetbuf &p)
Definition: gamemode_client.hpp:39
virtual void aifind(fpsent *d, ai::aistate &b, vector< ai::interest > &interests)
Definition: gamemode_client.hpp:46
virtual int clipconsole(int w, int h)
Definition: gamemode_client.hpp:30
void setradartex()
bind the minimap frame's texture
Definition: client.cpp:120
virtual void killed(fpsent *d, fpsent *actor)
Definition: gamemode_client.hpp:50