Tactics: Western Philosophers Vs. Musicians  0.12
A turn-based tactical game combining rules and gameplay elements inspired by Final Fantasy Tactics and the Mayfair Exponential Game System. Unlike most games of this type, motion is in full, grid-less 3D.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tactics3DRemotePC.h
Go to the documentation of this file.
1 // Copyright (C) 2014-2015 Dylan Blair
3 //
4 // email: dblair@alumni.cs.utexas.edu
5 //
6 // This file is part of Tactics3D.
7 //
8 // Tactics3D is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // Tactics3D is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 
23 #ifndef TACTICS3DREMOTE_PC_H
24 #define TACTICS3DREMOTE_PC_H
25 
26 #include "Tactics3DWarrior.h"
27 
28 #include "../Libs/Utils_LIB/UThread.h"
29 #include "../Libs/Utils_LIB/USocket.h"
30 
31 namespace Tactics3D {
33 #ifdef _WIN32
34  DWORD WINAPI recvPCAttributes(LPVOID arg);
35 #else
36  void* recvPCAttributes(void* arg);
37 #endif
38 
40  class RemotePC : public Warrior {
41  public:
43  int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_,
44  OpenSkyNet::Utils::Socket* socket_);
45 
46  virtual ~RemotePC() {}
47 
50  virtual void setPos(const OpenSkyNet::Math::Point<>& pos_);
52 
55  virtual void onMove();
56  virtual void onHipFire(OpenSkyNet::Core::Object* intendedTarget_, Action* action_);
57  virtual void onIronSightsFire(OpenSkyNet::Core::Object* intendedTarget_, Action* action_);
58  virtual void onEvocation();
59  virtual bool onAttack(std::vector<OpenSkyNet::Utils::TaggedUnion>& eventParams_);
61 
62  void recvActions(const std::vector<Warrior*>& warriors_);
63 
64  static void recvAttributes(OpenSkyNet::Utils::Socket* socket_);
65  static void resetAll(OpenSkyNet::Utils::Socket* socket_);
66  protected:
67  void recvAttack(std::vector<OpenSkyNet::Utils::TaggedUnion>& eventParams_);
68 
70  private:
71 #ifdef _WIN32
72  friend DWORD WINAPI recvPCAttributes(LPVOID arg);
73 #else
74  friend void* recvPCAttributes(void* arg);
75 #endif
76  static OpenSkyNet::Utils::Thread _recvPCThread;
77  static OpenSkyNet::Utils::uint _numPCsAttributesRequested;
78  static OpenSkyNet::Utils::uint _numPCsAttributesReceived;
79  };
80 }
81 
82 #endif //TACTICS3DREMOTE_PC_H
Definition: CPhysVisObject.h:30
Definition: Tactics3DRemotePC.h:40
Definition: Tactics3DAction.h:40
virtual ~RemotePC()
Definition: Tactics3DRemotePC.h:46
void * recvPCAttributes(void *arg)
Definition: Tactics3DRemotePC.cpp:18
virtual bool onAttack(std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
Definition: Tactics3DRemotePC.cpp:179
Definition: Tactics3DWarrior.h:42
void recvAttack(std::vector< OpenSkyNet::Utils::TaggedUnion > &eventParams_)
Definition: Tactics3DRemotePC.cpp:230
virtual void onEvocation()
Definition: Tactics3DRemotePC.cpp:170
virtual void onMove()
Definition: Tactics3DRemotePC.cpp:82
Definition: UThread.h:111
virtual void setPos(const OpenSkyNet::Math::Point<> &pos_)
Definition: Tactics3DRemotePC.cpp:71
virtual void onHipFire(OpenSkyNet::Core::Object *intendedTarget_, Action *action_)
Definition: Tactics3DRemotePC.cpp:142
Definition: USocket.h:46
static void resetAll(OpenSkyNet::Utils::Socket *socket_)
Definition: Tactics3DRemotePC.cpp:218
unsigned int uint
Definition: UTypes.h:39
OpenSkyNet::Utils::Socket * _socket
Definition: Tactics3DRemotePC.h:69
Definition: MPoint.h:33
virtual void onIronSightsFire(OpenSkyNet::Core::Object *intendedTarget_, Action *action_)
Definition: Tactics3DRemotePC.cpp:156
Definition: IObject.h:36
TEAM
Definition: Tactics3DWarrior.h:72
friend void * recvPCAttributes(void *arg)
Definition: Tactics3DRemotePC.cpp:18
RemotePC(OpenSkyNet::Utils::uint networkId_, OpenSkyNet::Core::PhysVisObject *pVO_, int gp_, int lvl_, int dex_, int str_, int end_, TEAM team_, OpenSkyNet::Utils::Socket *socket_)
Definition: Tactics3DRemotePC.cpp:64
void recvActions(const std::vector< Warrior * > &warriors_)
Definition: Tactics3DRemotePC.cpp:184
static void recvAttributes(OpenSkyNet::Utils::Socket *socket_)
Definition: Tactics3DRemotePC.cpp:212
float pos_[3]
Definition: ViewerApp.h:31