RBX::Instance

This commit is contained in:
floralrainfall 2023-07-06 20:30:19 -04:00
parent 9bb28ca413
commit abaa1add15
7 changed files with 102 additions and 3 deletions

View File

@ -1,10 +1,25 @@
cmake_minimum_required(VERSION 3.4)
project(engine)
project(player)
project(server)
project(studio)
add_executable(player
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_standard_project_setup()
add_library(engine STATIC
src/engine/app/humanoid/Humanoid.cpp
src/engine/app/humanoid/Humanoid.hpp
src/engine/app/v8/tree/Instance.cpp
src/engine/app/v8/tree/Instance.hpp
src/engine/app/Name.hpp
src/engine/app/Name.cpp
)
qt_add_executable(player
src/client/player/main.cpp
)
@ -12,6 +27,10 @@ add_executable(server
src/client/server/main.cpp
)
add_executable(studio
qt_add_executable(studio
src/client/studio/main.cpp
)
)
target_link_libraries(player PRIVATE Qt6::Core engine)
target_link_libraries(studio PRIVATE Qt6::Core engine)
target_link_libraries(server PRIVATE engine)

0
src/engine/app/Name.cpp Normal file
View File

20
src/engine/app/Name.hpp Normal file
View File

@ -0,0 +1,20 @@
#ifndef __APP_NAME_HPP__
#define __APP_NAME_HPP__
#include <map>
namespace RBX
{
class Name
{
public:
char* c_str();
static void compare(const RBX::Name *a, const RBX::Name *b);
static void declare(const char* sName, int dictionaryIndex);
static std::map<int, RBX::Name*>* dictionary();
};
}
#endif

View File

@ -0,0 +1,6 @@
#include "Humanoid.hpp"
RBX::Humanoid::Humanoid()
{
}

View File

@ -0,0 +1,25 @@
#ifndef __APP_HUMANOID_HUMANOID_HPP__
#define __APP_HUMANOID_HUMANOID_HPP__
namespace RBX
{
class Humanoid : Instance
{
private:
float m_health;
float m_maxHealth;
float m_walkRotationalVelocity;
public:
Humanoid();
~Humanoid();
bool canSit();
void buildJoints();
void checkForJointDeath();
void computeForce(float force, bool something);
void getTorso();
void getHead();
}
}
#endif

View File

@ -0,0 +1,10 @@
#include "Instance.hpp"
void RBX::Instance::setName(std::string name)
{
if(name != this->m_name)
{
this->m_name = name;
// raise property changed
}
}

View File

@ -0,0 +1,19 @@
#ifndef __APP_V8_TREE_INSTANCE_HPP__
#define __APP_V8_TREE_INSTANCE_HPP__
#include <string>
namespace RBX
{
class Instance
{
private:
std::string m_name;
public:
Instance();
void setName(std::string name);
}
}
#endif