Я пересоздал репозиторий из-за большого количества мусора в прошлом

This commit is contained in:
Jiga228
2025-09-14 15:00:44 +07:00
commit 78a25b305b
74 changed files with 3428 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
set(GAME_NAME TestGame)
set(CMAKE_CXX_STANDARD 20)
file(GLOB_RECURSE SRC "*.cpp" "*.c" "*.h" "*.hpp" "*.res" "*.world" "*.conf")
add_executable(${GAME_NAME} ${SRC})
target_link_libraries(${GAME_NAME} PRIVATE Core)
target_include_directories(${GAME_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/Core
${PROJECT_SOURCE_DIR}/FastRTTI
${PROJECT_SOURCE_DIR}/Delegate
)
if(MSVC)
set(OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
else()
set(OUTPUT_PATH ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()
add_custom_command(
TARGET ${GAME_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/main_config.conf
${OUTPUT_PATH}/main_config.conf
COMMENT "Copying main config file"
)
add_custom_command(
TARGET ${GAME_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/Worlds
${OUTPUT_PATH}/Worlds
COMMENT "Copying Worlds directory"
)
add_custom_command(
TARGET ${GAME_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/Resources
${OUTPUT_PATH}/Resources
COMMENT "Copying Resources directory"
)
+1
View File
@@ -0,0 +1 @@
test_double: 12345.700000
+1
View File
@@ -0,0 +1 @@
test_int: 12345
+1
View File
@@ -0,0 +1 @@
test_long: 1234567890123456789
+2
View File
@@ -0,0 +1,2 @@
test_string: Hello, Danil!
test_string2: Hello, User!
+1
View File
@@ -0,0 +1 @@
{"Class name":"TestWorld","dtime":5.000000,"Parent parameters":{"Class name":"World","loActors":[]}}
+1
View File
@@ -0,0 +1 @@
{"Class name":"MainConfig","sgame_name":"Test Game","sbase_world":"TestWorld","vsmodules_names":[]}
+9
View File
@@ -0,0 +1,9 @@
#include "TestActor.h"
#include "Log/Log.h"
void TestActor::BeginPlay()
{
Actor::BeginPlay();
Log("TestActor::BeginPlay");
}
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include "Game/Actors/Actor.h"
GENERATE_META(TestActor)
class TestActor final : public Actor
{
public:
void BeginPlay() override;
};
+7
View File
@@ -0,0 +1,7 @@
#include "Game/ObjectFactory.h"
#include "../Actors/TestActor.h"
FACTORIES_LIST{
GENERATE_FACTORY_OBJECT(TestActor)
};
+7
View File
@@ -0,0 +1,7 @@
#include "Game/WorldFactory.h"
#include "../Worlds/TestWorld.h"
WORLDS_LIST{
GENERATE_WORLD_FACTORY(TestWorld, TestWorld)
};
+12
View File
@@ -0,0 +1,12 @@
#include "TestGameInstance.h"
#include "Game/Resource/Resource.h"
#include <iostream>
#include "Game/SaveMap/SaveMap.h"
#include "Game/World/World.h"
GENERATE_FACTORY_GAME_INSTANCE(TestGameInstance)
TestGameInstance::TestGameInstance(CoreInstance& core) : GameInstance(core)
{
}
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include "Game/GameInstance.h"
class TestGameInstance : public GameInstance
{
public:
TestGameInstance(CoreInstance& core);
};
+40
View File
@@ -0,0 +1,40 @@
#include "TestWorld.h"
#include "Game/GameInstance.h"
#include "Game/SaveMap/SaveMap.h"
#include "Log/Log.h"
TestWorld::TestWorld(GameInstance& game_instance) : World(game_instance)
{}
void TestWorld::BeginPlay()
{
World::BeginPlay();
Log("TestWorld::BeginPlay");
}
void TestWorld::Tick(double delta_time)
{
World::Tick(delta_time);
time += delta_time;
if (time >= 10.0)
{
Message("TestWorld: Time out");
GetGameInstance().quit();
}
}
std::shared_ptr<SaveMap> TestWorld::save()
{
std::shared_ptr<SaveMap> save = World::save();
std::shared_ptr<SaveMap> my_save = std::make_shared<SaveMap>("TestWorld");
my_save->SaveDouble("time", time)->connect_to(save);
return my_save;
}
void TestWorld::load(std::shared_ptr<SaveMap> save)
{
World::load(save->getParent());
time = save->GetDouble("time");
}
+16
View File
@@ -0,0 +1,16 @@
#pragma once
#include "Game/World/World.h"
class TestWorld final : public World
{
double time = 0;
public:
TestWorld(GameInstance& game_instance);
void BeginPlay() override;
void Tick(double delta_time) override;
std::shared_ptr<SaveMap> save() override;
void load(std::shared_ptr<SaveMap> save) override;
};