Skip to content

Commit

Permalink
ref: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
guinpen98 committed Jan 21, 2024
1 parent 2561eb9 commit eca09ae
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Projects/IntegrationTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Projects/IntegrationTest/Data/Config.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
key value
asset_file ./../../
Binary file added Projects/IntegrationTest/Data/sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Projects/IntegrationTest/Source/EnvironmentTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*##########################################################################################
PAX SAPIENTICA Library 💀🌿🌏
[Planning] 2023-2024 As Project
[Production] 2023-2024 As Project
[Contact Us] [email protected] https://github.com/AsPJT/PAX_SAPIENTICA
[License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/
##########################################################################################*/

#include <string>

#include <PAX_SAPIENTICA/Simulation/Environment.hpp>

int main()
{
const std::string setting_file_path = "../../../Data/Simulations/MapList.tsv";
paxs::Environment<int> environment(setting_file_path);
std::cout << "data size: " << environment.data_map.size() << std::endl;
}
42 changes: 42 additions & 0 deletions Projects/IntegrationTest/Source/SFMLTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*##########################################################################################
PAX SAPIENTICA Library 💀🌿🌏
[Planning] 2023-2024 As Project
[Production] 2023-2024 As Project
[Contact Us] [email protected] https://github.com/AsPJT/PAX_SAPIENTICA
[License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/
##########################################################################################*/

#include <SFML/Graphics.hpp>

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;
}
23 changes: 23 additions & 0 deletions Projects/IntegrationTest/Source/SettlementSimulatorTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*##########################################################################################
PAX SAPIENTICA Library 💀🌿🌏
[Planning] 2023-2024 As Project
[Production] 2023-2024 As Project
[Contact Us] [email protected] https://github.com/AsPJT/PAX_SAPIENTICA
[License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/
##########################################################################################*/

#include <memory>

#include <PAX_SAPIENTICA/Simulation/SettlementSimulator.hpp>

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<paxs::SettlementSimulator<int>> simulator = std::make_unique<paxs::SettlementSimulator<int>>(map_list_path, japan_provinces_path, seed_gen());
simulator->init();
simulator->run(50);
}
22 changes: 22 additions & 0 deletions Projects/IntegrationTest/Source/SimulatorTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*##########################################################################################
PAX SAPIENTICA Library 💀🌿🌏
[Planning] 2023-2024 As Project
[Production] 2023-2024 As Project
[Contact Us] [email protected] https://github.com/AsPJT/PAX_SAPIENTICA
[License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/
##########################################################################################*/

#include <memory>

#include <PAX_SAPIENTICA/Simulation/Simulator.hpp>

int main() {
const std::string setting_file_path = "../../../Data/Simulations/MapList.tsv";
std::unique_ptr<paxs::Simulator<int>> simulator = std::make_unique<paxs::Simulator<int>>(setting_file_path, 10);
simulator->init();
simulator->run(50);
std::vector<paxs::Agent<int>> agents = simulator->getAgents();
}
31 changes: 31 additions & 0 deletions Projects/IntegrationTest/Source/WindowTest.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*##########################################################################################
PAX SAPIENTICA Library 💀🌿🌏
[Planning] 2023-2024 As Project
[Production] 2023-2024 As Project
[Contact Us] [email protected] https://github.com/AsPJT/PAX_SAPIENTICA
[License] Distributed under the CC0 1.0. https://creativecommons.org/publicdomain/zero/1.0/
##########################################################################################*/

#include <PAX_GRAPHICA/Circle.hpp>
#include <PAX_GRAPHICA/Graphics.hpp>
#include <PAX_GRAPHICA/Rect.hpp>
#include <PAX_GRAPHICA/String.hpp>
#include <PAX_GRAPHICA/Window.hpp>

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();
}
}

0 comments on commit eca09ae

Please sign in to comment.