Created
November 11, 2019 10:28
-
-
Save taipoxin/0a2e908c7e7c2ca621361a3a656830a2 to your computer and use it in GitHub Desktop.
test_app code files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# file: Core.h | |
#pragma once | |
#include "Entity.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#file: Entity.cpp | |
#include "Entity.h" | |
#include <iostream> | |
namespace Core | |
{ | |
typedef websocketpp::client<websocketpp::config::asio_client> client; | |
Entity::Entity(const char* name, float xPos, float yPos) | |
: m_Name(name), m_XPos(xPos), m_YPos(yPos) | |
{ | |
std::cout << "Created the Entity object!" << std::endl; | |
} | |
void Entity::Move(float deltaX, float deltaY) | |
{ | |
m_XPos += deltaX; | |
m_YPos += deltaY; | |
std::cout << "Moved " << m_Name << " to (" << m_XPos << ", " << m_YPos << ")." << std::endl; | |
} | |
void Entity::test() { | |
client cl; | |
std::cout << "Moved "; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#file: Entity.h | |
#pragma once | |
#include <websocketpp/client.hpp> | |
#include <websocketpp/config/asio_no_tls_client.hpp> | |
namespace Core | |
{ | |
class Entity | |
{ | |
public: | |
const char* m_Name; | |
private: | |
float m_XPos, m_YPos; | |
public: | |
Entity(const char* name, float xPos, float yPos); | |
void Move(float deltaX, float deltaY); | |
void test(); | |
inline float GetXPosition() const { return m_XPos; }; | |
inline float GetYPosition() const { return m_YPos; }; | |
inline const char* GETNAME() const { return m_Name; }; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment