Cafu Engine
ClientStateConnecting.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_CLIENT_STATE_CONNECTING_HPP_INCLUDED
8 #define CAFU_CLIENT_STATE_CONNECTING_HPP_INCLUDED
9 
10 #include "ClientState.hpp"
11 #include "Fonts/Font.hpp"
12 
13 
14 class ClientT;
15 class NetAddressT;
16 class NetDataT;
17 
18 
19 /// This class implements the "connecting-to-server" state of the client.
21 {
22  public:
23 
25 
26  // Implement the ClientStateT interface.
27  int GetID() const override;
28  bool ProcessInputEvent(const CaKeyboardEventT& KE) override;
29  bool ProcessInputEvent(const CaMouseEventT& ME) override;
30  void Render(float FrameTime) override;
31  void MainLoop(float FrameTime) override;
32 
33 
34  private:
35 
36  void ProcessConnectionLessPacket(NetDataT& InData, const NetAddressT& SenderAddress);
37 
38  ClientT& Client; ///< The context this state is a part of.
39  const unsigned long PacketID; ///< The packet ID with which we sent off our connection request.
40  float TimeLeft; ///< Time left after connection request to requeck ACK until timeout.
41 };
42 
43 #endif
Network address consisting of an IP4 address and port number.
Definition: Network.hpp:98
int GetID() const override
Returns some client-specific, unique ID for this state.
Definition: ClientStateConnecting.cpp:81
This class implements the "connecting-to-server" state of the client.
Definition: ClientStateConnecting.hpp:20
This struct describes a mouse event.
Definition: OpenGLWindow.hpp:185
Class that allows easy and portable handling, sending and receiving of data over a network...
Definition: Network.hpp:181
This struct describes a keyboard event.
Definition: OpenGLWindow.hpp:20
Definition: Client.hpp:24
This is the base class for the concrete classes that implement the states of the client.
Definition: ClientState.hpp:18