From eca09ae1351243d1067731d120eab6ba14f48ff0 Mon Sep 17 00:00:00 2001 From: guinpen98 <83969826+guinpen98@users.noreply.github.com> Date: Sun, 21 Jan 2024 22:58:50 +0900 Subject: [PATCH] ref: rename --- Projects/IntegrationTest/CMakeLists.txt | 12 ++--- Projects/IntegrationTest/Data/Config.tsv | 2 + Projects/IntegrationTest/Data/sample.png | Bin 0 -> 3376 bytes .../Source/EnvironmentTest.cpp | 21 +++++++++ Projects/IntegrationTest/Source/SFMLTest.cpp | 42 ++++++++++++++++++ .../Source/SettlementSimulatorTest.cpp | 23 ++++++++++ .../IntegrationTest/Source/SimulatorTest.cpp | 22 +++++++++ .../IntegrationTest/Source/WindowTest.cpp | 31 +++++++++++++ 8 files changed, 147 insertions(+), 6 deletions(-) create mode 100644 Projects/IntegrationTest/Data/Config.tsv create mode 100644 Projects/IntegrationTest/Data/sample.png create mode 100644 Projects/IntegrationTest/Source/EnvironmentTest.cpp create mode 100644 Projects/IntegrationTest/Source/SFMLTest.cpp create mode 100644 Projects/IntegrationTest/Source/SettlementSimulatorTest.cpp create mode 100644 Projects/IntegrationTest/Source/SimulatorTest.cpp create mode 100644 Projects/IntegrationTest/Source/WindowTest.cpp diff --git a/Projects/IntegrationTest/CMakeLists.txt b/Projects/IntegrationTest/CMakeLists.txt index 652cc30fc..0f37b28ee 100644 --- a/Projects/IntegrationTest/CMakeLists.txt +++ b/Projects/IntegrationTest/CMakeLists.txt @@ -7,24 +7,24 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../ExternalLibrary/googletest/googletest/include ) -add_executable(EnvironmentTest source/EnvironmentTest.cpp) -add_executable(WindowTest source/WindowTest.cpp) +add_executable(EnvironmentTest Source/EnvironmentTest.cpp) +add_executable(WindowTest Source/WindowTest.cpp) find_package(SFML 2.5 COMPONENTS graphics) if(SFML_FOUND) - add_executable(SFMLTest source/SFMLTest.cpp) + add_executable(SFMLTest Source/SFMLTest.cpp) target_link_libraries(SFMLTest sfml-graphics) add_definitions(-DPAXS_USING_SFML) target_link_libraries(WindowTest sfml-graphics sfml-window sfml-system) endif() -add_executable(SimulatorTest source/SimulatorTest.cpp) +add_executable(SimulatorTest Source/SimulatorTest.cpp) target_compile_definitions(SimulatorTest PRIVATE PAX_SAPIENTICA_DEBUG) -add_executable(SettlementSimulatorTest source/SettlementSimulatorTest.cpp) +add_executable(SettlementSimulatorTest Source/SettlementSimulatorTest.cpp) target_compile_definitions(SettlementSimulatorTest PRIVATE PAX_SAPIENTICA_DEBUG) -set(SOURCE_TSV_FILE "${CMAKE_CURRENT_SOURCE_DIR}/data/Config.tsv") +set(SOURCE_TSV_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Data/Config.tsv") set(DESTINATION_DIR "${CMAKE_CURRENT_BINARY_DIR}") add_custom_target(CopyTSV ALL diff --git a/Projects/IntegrationTest/Data/Config.tsv b/Projects/IntegrationTest/Data/Config.tsv new file mode 100644 index 000000000..3d3981d8c --- /dev/null +++ b/Projects/IntegrationTest/Data/Config.tsv @@ -0,0 +1,2 @@ +key value +asset_file ./../../ diff --git a/Projects/IntegrationTest/Data/sample.png b/Projects/IntegrationTest/Data/sample.png new file mode 100644 index 0000000000000000000000000000000000000000..efac08506f354cc894b6d55ff9ca38fcf2411e63 GIT binary patch literal 3376 zcmV-04bSq4P)k7RCt`-S!q;L*B0LA-kSje0SwscQ>?9uV{2EXPx~CHT2UOU zPp$R&)Y?`V6A}g$3JBtWQwN8ND7ID{(2zhFRc27ss)z%kB49v4fr1PP$$9JCi#%tI zU489(S?5PCS?iwfeEZwq-e&^|0Dr*+{}-?j`g35Z5gesKNkbfs$YLlpk4~Uz?pGB; zN*Z-M##2be(0>Hh#~$Ko>X^tfmom!&UItLJh6iPsF!pbI{ZypCgkRg;p zF)4^5KmAd#5K;l8i#u)l&h2aOkt^Jt0+)^s`g-)*FUIVhJtlMDzzoEs0lhM4#`2X@ z3f}6S3ZMZvIBVR`Uro!Pg(?aq@^~7C(a^Mpq7o>Id|?=}DC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QsXM4@ycp z?9|AS^ibpXv$M}HT9np>1fu=s{%AN5nf$6Lq@vidAVRSKS$vDom7k(-B(U6K-B)9e zb0b+WJrmnIJ~sI=i>alu^49k4IYWl1+5A_(`V5jC&*oU$MfgmIwcXY)9)04qVI|wz z76$}W#>Q42K73=thSO80rdV5ZLq~G?Hg#f)kP_gGz{X?EbRVfx=5tKz<+tj1_C>_0 z;jt0z>&=hZ89SW}uz$)wd?My#P=aS#{3~7dIZDX-9RuyhGzXAi+v#A0cdDiMnb)2_ z^M5`kx^{cj`PTn#A*6cY$oWrWOY_%+mGHv#=OcI~tp5N)ZgP^EM#5D90000 + +#include + +int main() +{ + const std::string setting_file_path = "../../../Data/Simulations/MapList.tsv"; + paxs::Environment environment(setting_file_path); + std::cout << "data size: " << environment.data_map.size() << std::endl; +} diff --git a/Projects/IntegrationTest/Source/SFMLTest.cpp b/Projects/IntegrationTest/Source/SFMLTest.cpp new file mode 100644 index 000000000..c567eea16 --- /dev/null +++ b/Projects/IntegrationTest/Source/SFMLTest.cpp @@ -0,0 +1,42 @@ +/*########################################################################################## + + PAX SAPIENTICA Library 💀🌿🌏 + + [Planning] 2023-2024 As Project + [Production] 2023-2024 As Project + [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/PAX_SAPIENTICA + [License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ + +##########################################################################################*/ + +#include + +int main() +{ + // ウィンドウの作成 + sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); + + // 四角形の作成 + sf::RectangleShape rectangle(sf::Vector2f(100.f, 100.f)); + rectangle.setFillColor(sf::Color::Red); + rectangle.setPosition(350.f, 250.f); + + // ゲームループ + while (window.isOpen()) + { + // イベントの処理 + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) + window.close(); + } + + // 描画 + window.clear(); + window.draw(rectangle); + window.display(); + } + + return 0; +} diff --git a/Projects/IntegrationTest/Source/SettlementSimulatorTest.cpp b/Projects/IntegrationTest/Source/SettlementSimulatorTest.cpp new file mode 100644 index 000000000..03d25017b --- /dev/null +++ b/Projects/IntegrationTest/Source/SettlementSimulatorTest.cpp @@ -0,0 +1,23 @@ +/*########################################################################################## + + PAX SAPIENTICA Library 💀🌿🌏 + + [Planning] 2023-2024 As Project + [Production] 2023-2024 As Project + [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/PAX_SAPIENTICA + [License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ + +##########################################################################################*/ + +#include + +#include + +int main() { + const std::string map_list_path = "Data/Simulations/MapList.tsv"; + const std::string& japan_provinces_path = "Data/Simulations/Japan200-725"; + std::random_device seed_gen; + std::unique_ptr> simulator = std::make_unique>(map_list_path, japan_provinces_path, seed_gen()); + simulator->init(); + simulator->run(50); +} diff --git a/Projects/IntegrationTest/Source/SimulatorTest.cpp b/Projects/IntegrationTest/Source/SimulatorTest.cpp new file mode 100644 index 000000000..7e0fa8756 --- /dev/null +++ b/Projects/IntegrationTest/Source/SimulatorTest.cpp @@ -0,0 +1,22 @@ +/*########################################################################################## + + PAX SAPIENTICA Library 💀🌿🌏 + + [Planning] 2023-2024 As Project + [Production] 2023-2024 As Project + [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/PAX_SAPIENTICA + [License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ + +##########################################################################################*/ + +#include + +#include + +int main() { + const std::string setting_file_path = "../../../Data/Simulations/MapList.tsv"; + std::unique_ptr> simulator = std::make_unique>(setting_file_path, 10); + simulator->init(); + simulator->run(50); + std::vector> agents = simulator->getAgents(); +} diff --git a/Projects/IntegrationTest/Source/WindowTest.cpp b/Projects/IntegrationTest/Source/WindowTest.cpp new file mode 100644 index 000000000..65edd14da --- /dev/null +++ b/Projects/IntegrationTest/Source/WindowTest.cpp @@ -0,0 +1,31 @@ +/*########################################################################################## + + PAX SAPIENTICA Library 💀🌿🌏 + + [Planning] 2023-2024 As Project + [Production] 2023-2024 As Project + [Contact Us] wanotaitei@gmail.com https://github.com/AsPJT/PAX_SAPIENTICA + [License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/ + +##########################################################################################*/ + +#include +#include +#include +#include +#include + +int main() { + paxg::Rect rect(0, 0, 100, 100); + // paxg::Circle circle(100, 100, 50); + paxg::String path("../data/sample.png"); + paxg::Texture texture(path); + paxg::Window::Init(800, 600, "PAX SAPIENTICA Library"); + while (paxg::Window::update()) { + paxg::Window::clear(); + rect.draw(); + // circle.draw(); + // texture.drawAt({200, 200}); + paxg::Window::display(); + } +}