Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hideandseek_client.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "inexor/client/gamemode/gamemode_client.hpp" // for clientmode
3 #include "inexor/fpsgame/fps.hpp" // for player1
4 #include "inexor/fpsgame/fpsent.hpp" // for fpsent
5 #include "inexor/gamemode/hideandseek_common.hpp" // for hideandseekmode
6 #include "inexor/network/SharedVar.hpp" // for SharedVar
7 #include "inexor/network/legacy/buffer_types.hpp" // for ucharbuf
8 #include "inexor/physics/physics.hpp" // for findplayerspawn
9 
10 struct g3d_gui;
11 struct scoregroup;
12 struct vec;
13 
14 namespace game {
15 
17 
19 {
20  static constexpr int STARTINVISIBLESECS = 30;
21 
22  void setup() override {}
23 
24  void drawblip(fpsent *d, float x, float y, float s, const vec &pos, float size_factor);
25 
26  void drawhud(fpsent *d, int w, int h) override;
27 
28  bool isinvisible(fpsent *d) override;
29 
30  void rendergame() override
31  {
32  }
33 
34  void renderscoreboard(g3d_gui &g, scoregroup &sg, int fgcolor, int bgcolor) override
35  {
36  /*
37  if (showhideandseekrole) {
38  g.pushlist();
39  g.strut(4);
40  g.text("rank", fgcolor);
41  loopv(sg.players) {
42  fpsent *d = sg.players[i];
43  g.textf("%s", 0xFFFFDD, NULL, "");
44  }
45  g.poplist();
46  }
47  */
48  }
49 
50  void killed(fpsent *d, fpsent *actor) override
51  {
52  }
53 
54  void respawned(fpsent *d) override
55  {
56  }
57 
58  void pickspawn(fpsent *d) override
59  {
60  findplayerspawn(player1); // TODO: Is this correct??
61  }
62 
63  bool hidefrags() override
64  {
65  return true;
66  }
67 
68  bool parse_network_message(int type, ucharbuf &p) override
69  {
70  switch(type)
71  {
72  /*
73  case N_RACEINFO:
74  {
75  int rcn = getint(p);
76  return true;
77  }
78  */
79  default: break;
80  }
81  return false;
82  }
83 };
84 
85 extern hideandseekclientmode hideandseekmode;
86 
87 
88 } // ns game
Definition: gamemode_client.hpp:25
void rendergame() override
Definition: hideandseek_client.hpp:30
void pickspawn(fpsent *d) override
Definition: hideandseek_client.hpp:58
bool isinvisible(fpsent *d) override
Definition: hideandseek_client.cpp:78
template implementation of buffers (networking e.g.).
Definition: buffer_types.hpp:14
fpsent * player1
Definition: fps.cpp:61
bool parse_network_message(int type, ucharbuf &p) override
Parse game mode specific network messages.
Definition: hideandseek_client.hpp:68
Definition: hideandseek_client.hpp:18
SharedVar< int > showminimapobstacles
static constexpr int STARTINVISIBLESECS
Definition: hideandseek_client.hpp:20
void drawhud(fpsent *d, int w, int h) override
Definition: hideandseek_client.cpp:41
hideandseekclientmode hideandseekmode
Definition: client.cpp:210
void respawned(fpsent *d) override
Definition: hideandseek_client.hpp:54
Definition: 3dgui.hpp:52
vector with 3 floats and some useful methods.
Definition: geom.hpp:110
void drawblip(fpsent *d, float x, float y, float s, const vec &pos, float size_factor)
Definition: hideandseek_client.cpp:28
void findplayerspawn(dynent *d, int forceent, int tag)
Definition: world.cpp:1234
int d
Definition: octaedit.cpp:1749
void setup() override
Definition: hideandseek_client.hpp:22
Definition: fpsent.hpp:12
bool hidefrags() override
Definition: hideandseek_client.hpp:63
void killed(fpsent *d, fpsent *actor) override
Definition: hideandseek_client.hpp:50
SharedVar wrapper for primitive/immutable objects.
Definition: SharedVar.hpp:55
Definition: hideandseek_common.hpp:7
Used only for the scoreboard.
Definition: teaminfo.hpp:80
void renderscoreboard(g3d_gui &g, scoregroup &sg, int fgcolor, int bgcolor) override
Definition: hideandseek_client.hpp:34