Compare commits
	
		
			No commits in common. "2b59a832a458f9a5cb14073b67533d8f9f33abb0" and "f7862f09f9375eecb940f3e814564be91ea23a97" have entirely different histories.
		
	
	
		
			
				2b59a832a4
			
			...
			
				f7862f09f9
			
		
	
		
					 15 changed files with 371 additions and 144 deletions
				
			
		
							
								
								
									
										9
									
								
								.gitmodules
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.gitmodules
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,3 +1,12 @@
 | 
				
			||||||
 | 
					[submodule "external/spdlog"]
 | 
				
			||||||
 | 
						path = external/spdlog
 | 
				
			||||||
 | 
						url = https://github.com/gabime/spdlog.git
 | 
				
			||||||
 | 
					[submodule "external/json"]
 | 
				
			||||||
 | 
						path = external/json
 | 
				
			||||||
 | 
						url = https://github.com/nlohmann/json.git
 | 
				
			||||||
[submodule "external/catch2"]
 | 
					[submodule "external/catch2"]
 | 
				
			||||||
	path = external/catch2
 | 
						path = external/catch2
 | 
				
			||||||
	url = https://github.com/catchorg/Catch2.git
 | 
						url = https://github.com/catchorg/Catch2.git
 | 
				
			||||||
 | 
					[submodule "external/svector"]
 | 
				
			||||||
 | 
						path = external/svector
 | 
				
			||||||
 | 
						url = https://github.com/martinus/svector.git
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								.idea/cmake.xml
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.idea/cmake.xml
									
										
									
										generated
									
									
									
								
							| 
						 | 
					@ -2,9 +2,9 @@
 | 
				
			||||||
<project version="4">
 | 
					<project version="4">
 | 
				
			||||||
  <component name="CMakeSharedSettings">
 | 
					  <component name="CMakeSharedSettings">
 | 
				
			||||||
    <configurations>
 | 
					    <configurations>
 | 
				
			||||||
      <configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-G Ninja -DJSON_SystemInclude=ON" />
 | 
					      <configuration PROFILE_NAME="Debug" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-G Ninja" />
 | 
				
			||||||
      <configuration PROFILE_NAME="Debug Coverage" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-G Ninja -DENABLE_COVERAGE=ON -DJSON_SystemInclude=ON" />
 | 
					      <configuration PROFILE_NAME="Debug Coverage" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-G Ninja -DENABLE_COVERAGE=ON" />
 | 
				
			||||||
      <configuration PROFILE_NAME="Release" ENABLED="true" CONFIG_NAME="Release" GENERATION_OPTIONS="-G Ninja -DJSON_SystemInclude=ON" />
 | 
					      <configuration PROFILE_NAME="Release" ENABLED="true" CONFIG_NAME="Release" GENERATION_OPTIONS="-G Ninja" />
 | 
				
			||||||
    </configurations>
 | 
					    </configurations>
 | 
				
			||||||
  </component>
 | 
					  </component>
 | 
				
			||||||
</project>
 | 
					</project>
 | 
				
			||||||
| 
						 | 
					@ -1,10 +1,6 @@
 | 
				
			||||||
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
 | 
					cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
 | 
				
			||||||
project(BillySheet LANGUAGES CXX)
 | 
					project(BillySheet LANGUAGES CXX)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include(GNUInstallDirs)
 | 
					 | 
				
			||||||
include(CMakePackageConfigHelpers)
 | 
					 | 
				
			||||||
include(FetchContent)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
file(GLOB_RECURSE SOURCE_HEADERS include/*.h include/*.hpp)
 | 
					file(GLOB_RECURSE SOURCE_HEADERS include/*.h include/*.hpp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
 | 
					file(GLOB_RECURSE SOURCE_FILES src/*.cpp)
 | 
				
			||||||
| 
						 | 
					@ -14,9 +10,6 @@ set(SOURCES
 | 
				
			||||||
        ${SOURCE_FILES}
 | 
					        ${SOURCE_FILES}
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
find_package(PkgConfig REQUIRED)
 | 
					 | 
				
			||||||
pkg_check_modules(Jemalloc REQUIRED IMPORTED_TARGET jemalloc)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
find_program(CCACHE_FOUND ccache)
 | 
					find_program(CCACHE_FOUND ccache)
 | 
				
			||||||
if (CCACHE_FOUND)
 | 
					if (CCACHE_FOUND)
 | 
				
			||||||
    message(STATUS "ccache found !")
 | 
					    message(STATUS "ccache found !")
 | 
				
			||||||
| 
						 | 
					@ -28,11 +21,20 @@ else ()
 | 
				
			||||||
    message(STATUS "ccache not found")
 | 
					    message(STATUS "ccache not found")
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fetchcontent_declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz)
 | 
					add_subdirectory(external/svector)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					option(SPDLOG_ENABLE_PCH "Build static or shared library using precompiled header to speed up compilation time" ON)
 | 
				
			||||||
 | 
					option(SPDLOG_BUILD_WARNINGS "Enable compiler warnings" ON)
 | 
				
			||||||
 | 
					option(SPDLOG_PREVENT_CHILD_FD "Prevent from child processes to inherit log file descriptors" ON)
 | 
				
			||||||
 | 
					option(SPDLOG_NO_THREAD_ID "prevent spdlog from querying the thread id on each log call if thread id is not needed" ON)
 | 
				
			||||||
 | 
					option(SPDLOG_NO_TLS "prevent spdlog from using thread local storage" ON)
 | 
				
			||||||
 | 
					option(SPDLOG_NO_ATOMIC_LEVELS "prevent spdlog from using of std::atomic log levels (use only if your code never modifies log levels concurrently" ON)
 | 
				
			||||||
 | 
					add_subdirectory(external/spdlog)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set(JSON_BuildTests OFF CACHE INTERNAL "")
 | 
					set(JSON_BuildTests OFF CACHE INTERNAL "")
 | 
				
			||||||
option(JSON_ImplicitConversions "Enable implicit conversions." OFF)
 | 
					option(JSON_ImplicitConversions "Enable implicit conversions." OFF)
 | 
				
			||||||
option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)." ON)
 | 
					option(JSON_SystemInclude "Include as system headers (skip for clang-tidy)." ON)
 | 
				
			||||||
fetchcontent_makeavailable(json)
 | 
					add_subdirectory(external/json)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option(CATCH_INSTALL_DOCS "Install documentation alongside library" OFF)
 | 
					option(CATCH_INSTALL_DOCS "Install documentation alongside library" OFF)
 | 
				
			||||||
option(CATCH_INSTALL_EXTRAS "Install extras alongside library" OFF)
 | 
					option(CATCH_INSTALL_EXTRAS "Install extras alongside library" OFF)
 | 
				
			||||||
| 
						 | 
					@ -62,6 +64,10 @@ set(LINKER_OPTIONS
 | 
				
			||||||
        -fdevirtualize-at-ltrans
 | 
					        -fdevirtualize-at-ltrans
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set(LINKER_FLAGS
 | 
				
			||||||
 | 
					        jemalloc
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
option(ENABLE_COVERAGE "Enabling coverage" OFF)
 | 
					option(ENABLE_COVERAGE "Enabling coverage" OFF)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (${ENABLE_COVERAGE})
 | 
					if (${ENABLE_COVERAGE})
 | 
				
			||||||
| 
						 | 
					@ -71,58 +77,43 @@ if (${ENABLE_COVERAGE})
 | 
				
			||||||
    list(APPEND LINKER_FLAGS gcov)
 | 
					    list(APPEND LINKER_FLAGS gcov)
 | 
				
			||||||
endif ()
 | 
					endif ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					add_subdirectory("Unit testing")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_library(BillySheet SHARED ${SOURCES})
 | 
					add_library(BillySheet SHARED ${SOURCES})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_include_directories(BillySheet
 | 
					target_include_directories(BillySheet PRIVATE include include/imgui external/ImFileDialog)
 | 
				
			||||||
        PUBLIC
 | 
					 | 
				
			||||||
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
 | 
					 | 
				
			||||||
        $<INSTALL_INTERFACE:${CMAKE_INSTALL_INDLUDEDIR}/billySheet>
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
set_target_properties(BillySheet PROPERTIES
 | 
					set_target_properties(BillySheet spdlog svector PROPERTIES
 | 
				
			||||||
        CXX_STANDARD 17
 | 
					        CXX_STANDARD 17
 | 
				
			||||||
        CXX_STANDARD_REQUIRED ON
 | 
					        CXX_STANDARD_REQUIRED ON
 | 
				
			||||||
        CXX_EXTENSIONS OFF
 | 
					        CXX_EXTENSIONS OFF
 | 
				
			||||||
        INTERPROCEDURAL_OPTIMIZATION ON
 | 
					        INTERPROCEDURAL_OPTIMIZATION ON
 | 
				
			||||||
        UNITY_BUILD ON
 | 
					        # UNITY_BUILD ON
 | 
				
			||||||
        PUBLIC_HEADER "include/billy_objects.hpp;include/character_sheet.hpp;include/generic_object.hpp;include/characteristic.hpp"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set_target_properties(spdlog svector PROPERTIES UNITY_BUILD ON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_compile_definitions(BillySheet PRIVATE
 | 
					target_compile_definitions(BillySheet PRIVATE
 | 
				
			||||||
        $<$<CONFIG:Debug>:_GLIBCXX_DEBUG>
 | 
					        $<$<CONFIG:Debug>:_GLIBCXX_DEBUG>
 | 
				
			||||||
)
 | 
					        $<$<CONFIG:Debug>:SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_DEBUG>
 | 
				
			||||||
 | 
					        $<$<CONFIG:Release>:SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_ERROR>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					target_compile_definitions(spdlog PRIVATE $<$<CONFIG:Debug>:_GLIBCXX_DEBUG>)
 | 
				
			||||||
 | 
					target_compile_definitions(svector INTERFACE $<$<CONFIG:Debug>:_GLIBCXX_DEBUG>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					target_compile_options(spdlog PRIVATE ${COMPILE_FLAGS})
 | 
				
			||||||
 | 
					target_compile_options(svector INTERFACE ${COMPILE_FLAGS})
 | 
				
			||||||
target_compile_options(BillySheet PRIVATE ${COMPILE_FLAGS})
 | 
					target_compile_options(BillySheet PRIVATE ${COMPILE_FLAGS})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					target_link_options(spdlog PRIVATE ${LINKER_OPTIONS})
 | 
				
			||||||
 | 
					target_link_options(svector INTERFACE ${LINKER_OPTIONS})
 | 
				
			||||||
target_link_options(BillySheet PRIVATE ${LINKER_OPTIONS})
 | 
					target_link_options(BillySheet PRIVATE ${LINKER_OPTIONS})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
target_link_libraries(BillySheet PUBLIC
 | 
					target_link_libraries(spdlog PRIVATE ${LINKER_FLAGS})
 | 
				
			||||||
 | 
					target_link_libraries(svector INTERFACE ${LINKER_FLAGS})
 | 
				
			||||||
 | 
					target_link_libraries(BillySheet glfw
 | 
				
			||||||
 | 
					        spdlog::spdlog_header_only
 | 
				
			||||||
 | 
					        svector::svector
 | 
				
			||||||
        nlohmann_json::nlohmann_json
 | 
					        nlohmann_json::nlohmann_json
 | 
				
			||||||
        PkgConfig::Jemalloc
 | 
					        ${LINKER_FLAGS}
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					 | 
				
			||||||
install(TARGETS BillySheet nlohmann_json
 | 
					 | 
				
			||||||
        EXPORT billySheetTargets
 | 
					 | 
				
			||||||
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
 | 
					 | 
				
			||||||
        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
 | 
					 | 
				
			||||||
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 | 
					 | 
				
			||||||
        PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/billySheet"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
install(EXPORT billySheetTargets
 | 
					 | 
				
			||||||
        FILE billySheetTargets.cmake
 | 
					 | 
				
			||||||
        NAMESPACE billySheet::
 | 
					 | 
				
			||||||
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/billySheet
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
 | 
					 | 
				
			||||||
        "${CMAKE_CURRENT_BINARY_DIR}/billySheetConfig.cmake"
 | 
					 | 
				
			||||||
        INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/billySheet
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
install(FILES
 | 
					 | 
				
			||||||
        "${CMAKE_CURRENT_BINARY_DIR}/billySheetConfig.cmake"
 | 
					 | 
				
			||||||
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/billySheet
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
add_subdirectory("Unit testing")
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +0,0 @@
 | 
				
			||||||
@PACKAGE_INIT@
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
include("${CMAKE_CURRENT_LIST_DIR}/billySheetTargets.cmake")
 | 
					 | 
				
			||||||
include(CMakeFindDependencyMacro)
 | 
					 | 
				
			||||||
find_dependency(PkgConfig REQUIRED)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
check_required_components(billySheet)
 | 
					 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,7 @@ include(../external/catch2/extras/Catch.cmake)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_executable(UnitTest adummy.cpp
 | 
					add_executable(UnitTest adummy.cpp
 | 
				
			||||||
        characteristics_tests.cpp
 | 
					        characteristics_tests.cpp
 | 
				
			||||||
 | 
					        ../src/billy_objects.cpp
 | 
				
			||||||
        billy_objects_tests.cpp
 | 
					        billy_objects_tests.cpp
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,9 +19,9 @@ set_target_properties(Catch2 UnitTest svector PROPERTIES
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
target_include_directories(UnitTest PRIVATE ${CMAKE_SOURCE_DIR}/include)
 | 
					target_include_directories(UnitTest PRIVATE ${CMAKE_SOURCE_DIR}/include)
 | 
				
			||||||
target_compile_definitions(UnitTest PRIVATE ${DEF_COMP})
 | 
					target_compile_definitions(UnitTest PRIVATE ${DEF_COMP})
 | 
				
			||||||
target_compile_options(UnitTest PRIVATE ${COMPILE_FLAGS} -fdiagnostics-all-candidates)
 | 
					target_compile_options(UnitTest PRIVATE ${COMPILE_FLAGS})
 | 
				
			||||||
target_link_options(UnitTest PRIVATE ${LINKER_OPTIONS})
 | 
					target_link_options(UnitTest PRIVATE ${LINKER_OPTIONS})
 | 
				
			||||||
target_link_libraries(UnitTest ${LINKER_FLAGS} spdlog::spdlog_header_only Catch2::Catch2WithMain nlohmann_json::nlohmann_json svector::svector BillySheet)
 | 
					target_link_libraries(UnitTest ${LINKER_FLAGS} spdlog::spdlog_header_only Catch2::Catch2WithMain nlohmann_json::nlohmann_json svector::svector)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enable_testing()
 | 
					enable_testing()
 | 
				
			||||||
catch_discover_tests(UnitTest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} REPORTER junit OUTPUT_DIR ${CMAKE_SOURCE_DIR} OUTPUT_PREFIX cppspec- OUTPUT_SUFFIX .xml)
 | 
					catch_discover_tests(UnitTest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} REPORTER junit OUTPUT_DIR ${CMAKE_SOURCE_DIR} OUTPUT_PREFIX cppspec- OUTPUT_SUFFIX .xml)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								external/json
									
										
									
									
										vendored
									
									
										Submodule
									
								
							
							
						
						
									
										1
									
								
								external/json
									
										
									
									
										vendored
									
									
										Submodule
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Subproject commit 9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03
 | 
				
			||||||
							
								
								
									
										1
									
								
								external/spdlog
									
										
									
									
										vendored
									
									
										Submodule
									
								
							
							
						
						
									
										1
									
								
								external/spdlog
									
										
									
									
										vendored
									
									
										Submodule
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Subproject commit 27cb4c76708608465c413f6d0e6b8d99a4d84302
 | 
				
			||||||
							
								
								
									
										1
									
								
								external/svector
									
										
									
									
										vendored
									
									
										Submodule
									
								
							
							
						
						
									
										1
									
								
								external/svector
									
										
									
									
										vendored
									
									
										Submodule
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					Subproject commit cbeced42e061da03b881ba1d09621d4604de030a
 | 
				
			||||||
| 
						 | 
					@ -10,23 +10,46 @@
 | 
				
			||||||
#include <functional>
 | 
					#include <functional>
 | 
				
			||||||
#include <variant>
 | 
					#include <variant>
 | 
				
			||||||
#include <string_view>
 | 
					#include <string_view>
 | 
				
			||||||
#include <unordered_map>
 | 
					#include <ankerl/svector.h>
 | 
				
			||||||
#include <nlohmann/json_fwd.hpp>
 | 
					#include "characteristic/characteristic.hpp"
 | 
				
			||||||
#include "generic_object.hpp"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// helper type for the visitor
 | 
				
			||||||
 | 
					template<typename... Ts>
 | 
				
			||||||
 | 
					struct overloaded : Ts ... { using Ts::operator()...; };
 | 
				
			||||||
 | 
					template<typename... Ts>
 | 
				
			||||||
 | 
					overloaded(Ts...) -> overloaded<Ts...>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace character {
 | 
					namespace character {
 | 
				
			||||||
    class CharacterSheet;
 | 
					    class CharacterSheet;
 | 
				
			||||||
    namespace characteristic{
 | 
					
 | 
				
			||||||
        class Characteristic;
 | 
					    enum class weapons : std::uint8_t {
 | 
				
			||||||
    }
 | 
					        Sword = 0,
 | 
				
			||||||
 | 
					        Lance = 1,
 | 
				
			||||||
 | 
					        Morgenstern = 2,
 | 
				
			||||||
 | 
					        Bow = 3
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    enum class equipments : std::uint8_t {
 | 
				
			||||||
 | 
					        Chainmail = 4,
 | 
				
			||||||
 | 
					        CookingPot = 5,
 | 
				
			||||||
 | 
					        PamphletTourist = 6,
 | 
				
			||||||
 | 
					        MedicKit = 7
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    enum class tools : std::uint8_t {
 | 
				
			||||||
 | 
					        Fourche = 8,
 | 
				
			||||||
 | 
					        Dagger = 9,
 | 
				
			||||||
 | 
					        RockClimbingKit = 10,
 | 
				
			||||||
 | 
					        SackOfGrain = 11
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class BillyObjects final {
 | 
					    class BillyObjects final {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        using json = nlohmann::json;
 | 
					        static constexpr std::size_t max_num_obj{ 3 };
 | 
				
			||||||
        using container = std::unordered_map<billyEnums, billyObjects>;
 | 
					        using billyObject = std::variant<weapons, equipments, tools>;
 | 
				
			||||||
 | 
					        using container = ankerl::svector<billyObject, max_num_obj>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static constexpr std::array<billyEnums, 12> all_objects{
 | 
					        static constexpr std::array<BillyObjects::billyObject, 12> all_objects{
 | 
				
			||||||
                weapons::Sword,
 | 
					                weapons::Sword,
 | 
				
			||||||
                weapons::Lance,
 | 
					                weapons::Lance,
 | 
				
			||||||
                weapons::Morgenstern,
 | 
					                weapons::Morgenstern,
 | 
				
			||||||
| 
						 | 
					@ -43,7 +66,22 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static constexpr std::string_view json_key{ "billy_objects" };
 | 
					        static constexpr std::string_view json_key{ "billy_objects" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static std::string_view billy_object_to_string(const billyObjects &object) noexcept;
 | 
					        static constexpr std::string_view sword{ "Sword" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view lance{ "Lance" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view morgenstern{ "Morgenstern" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view bow{ "Bow" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static constexpr std::string_view chainmail{ "Chainmail" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view cooking_pot{ "Cooking pot" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view pamphlet_tourist{ "Touristic pamphlet" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view medic_kit{ "Medic kit" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static constexpr std::string_view fourche{ "Fourche" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view dagger{ "Dagger" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view rock_climbing_kit{ "Rock climbing kit" };
 | 
				
			||||||
 | 
					        static constexpr std::string_view sack_of_grain{ "Sack of grain" };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static std::string_view billy_object_to_string(const billyObject &object) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static void to_json(json &j, const BillyObjects::container &billy);
 | 
					        static void to_json(json &j, const BillyObjects::container &billy);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,30 +91,47 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ~BillyObjects() noexcept = default;
 | 
					        ~BillyObjects() noexcept = default;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] bool insert_object(CharacterSheet &sheet, const billyEnums objType) noexcept;
 | 
					        [[nodiscard]] bool push_object(const billyObject &object, CharacterSheet &sheet) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        void erase_object(CharacterSheet &sheet, const billyEnums objToErase) noexcept;
 | 
					        void pop_object(CharacterSheet &sheet) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [[nodiscard]] static ankerl::svector<bool, 3> check_conformity(const CharacterSheet &sheet) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] const std::plus<std::uint32_t> &get_plus_operation() const { return plus; }
 | 
					        [[nodiscard]] const std::plus<std::uint32_t> &get_plus_operation() const { return plus; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] const std::minus<std::uint32_t> &get_minus_operation() const { return minus; }
 | 
					        [[nodiscard]] const std::minus<std::uint32_t> &get_minus_operation() const { return minus; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static void check_dagger_conditions(const CharacterSheet &sheet,
 | 
					 | 
				
			||||||
                characteristic::Characteristic &localHabilete,
 | 
					 | 
				
			||||||
                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    private:
 | 
					    private:
 | 
				
			||||||
        std::plus<std::uint32_t> plus;
 | 
					        std::plus<std::uint32_t> plus;
 | 
				
			||||||
 | 
					 | 
				
			||||||
        std::minus<std::uint32_t> minus;
 | 
					        std::minus<std::uint32_t> minus;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static void change_carac(const billyObjects &arg,
 | 
					        static void change_carac_weapon(const weapons &arg,
 | 
				
			||||||
 | 
					                CharacterSheet &sheet,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localHabilete,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localAdresse,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localEndurance,
 | 
				
			||||||
 | 
					                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static void change_carac_equipment(const equipments &arg,
 | 
				
			||||||
 | 
					                CharacterSheet &sheet,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localHabilete,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localAdresse,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localEndurance,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localChance,
 | 
				
			||||||
 | 
					                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &primary,
 | 
				
			||||||
 | 
					                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &complement) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static void change_carac_tools(const tools &arg,
 | 
				
			||||||
                CharacterSheet &sheet,
 | 
					                CharacterSheet &sheet,
 | 
				
			||||||
                characteristic::Characteristic &localHabilete,
 | 
					                characteristic::Characteristic &localHabilete,
 | 
				
			||||||
                characteristic::Characteristic &localAdresse,
 | 
					                characteristic::Characteristic &localAdresse,
 | 
				
			||||||
                characteristic::Characteristic &localEndurance,
 | 
					                characteristic::Characteristic &localEndurance,
 | 
				
			||||||
                characteristic::Characteristic &localChance,
 | 
					                characteristic::Characteristic &localChance,
 | 
				
			||||||
                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) noexcept;
 | 
					                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        static void check_dagger_conditions(const CharacterSheet &sheet,
 | 
				
			||||||
 | 
					                characteristic::Characteristic &localHabilete,
 | 
				
			||||||
 | 
					                const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
#ifndef BILLYSHEET_CHARACTER_SHEET_HPP
 | 
					#ifndef BILLYSHEET_CHARACTER_SHEET_HPP
 | 
				
			||||||
#define BILLYSHEET_CHARACTER_SHEET_HPP
 | 
					#define BILLYSHEET_CHARACTER_SHEET_HPP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "characteristic.hpp"
 | 
					#include "characteristic/characteristic.hpp"
 | 
				
			||||||
#include "billy_objects.hpp"
 | 
					#include "billy_objects.hpp"
 | 
				
			||||||
#include <unordered_set>
 | 
					#include <unordered_set>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -32,7 +32,7 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BillyObjects::container objects;
 | 
					        BillyObjects::container objects;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        std::unordered_set<billyEnums> available_objects{
 | 
					        std::unordered_set<BillyObjects::billyObject> available_objects{
 | 
				
			||||||
                BillyObjects::all_objects.cbegin(),
 | 
					                BillyObjects::all_objects.cbegin(),
 | 
				
			||||||
                BillyObjects::all_objects.cend()
 | 
					                BillyObjects::all_objects.cend()
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,7 @@
 | 
				
			||||||
#include <variant>
 | 
					#include <variant>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
#include <string_view>
 | 
					#include <string_view>
 | 
				
			||||||
 | 
					#include "characteristic/characteristic.hpp"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// helper type for the visitor
 | 
					// helper type for the visitor
 | 
				
			||||||
template<typename... Ts>
 | 
					template<typename... Ts>
 | 
				
			||||||
| 
						 | 
					@ -17,10 +18,6 @@ template<typename... Ts>
 | 
				
			||||||
overloaded(Ts...) -> overloaded<Ts...>;
 | 
					overloaded(Ts...) -> overloaded<Ts...>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace character {
 | 
					namespace character {
 | 
				
			||||||
    namespace characteristic {
 | 
					 | 
				
			||||||
        enum class characType : std::uint8_t;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    using namespace std::string_literals;
 | 
					    using namespace std::string_literals;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    enum class weapons : std::uint8_t {
 | 
					    enum class weapons : std::uint8_t {
 | 
				
			||||||
| 
						 | 
					@ -62,7 +59,7 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] virtual std::uint32_t add_damage() const noexcept = 0;
 | 
					        [[nodiscard]] virtual std::uint32_t add_damage() const noexcept = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] virtual std::int32_t add_materiel(const characteristic::characType &inType) const noexcept = 0;
 | 
					        [[nodiscard]] virtual std::int32_t add_materiel(const characteristic::characType inType) const noexcept = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] virtual std::string_view to_string() const noexcept = 0;
 | 
					        [[nodiscard]] virtual std::string_view to_string() const noexcept = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -71,11 +68,13 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    using billyObjects = std::unique_ptr<GenericObject>;
 | 
					    using billyObjects = std::unique_ptr<GenericObject>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    static billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Weapons final : virtual public GenericObject {
 | 
					    class Weapons final : virtual public GenericObject {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        const weapons type{ weapons::Sword };
 | 
					        const weapons type{ weapons::Sword };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        explicit Weapons(const weapons type) : type(type) {}
 | 
					        friend billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Weapons() = delete;
 | 
					        Weapons() = delete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -87,18 +86,21 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::uint32_t add_damage() const noexcept final;
 | 
					        [[nodiscard]] std::uint32_t add_damage() const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::int32_t add_materiel(const characteristic::characType &inType) const noexcept final;
 | 
					        [[nodiscard]] std::int32_t add_materiel(const characteristic::characType inType) const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
					        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
					        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private:
 | 
				
			||||||
 | 
					        explicit Weapons(const weapons type) : type(type) {}
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Equipments final : virtual public GenericObject {
 | 
					    class Equipments final : virtual public GenericObject {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        const equipments type{ equipments::Chainmail };
 | 
					        const equipments type{ equipments::Chainmail };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        explicit Equipments(const equipments type) : type(type) {}
 | 
					        friend billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Equipments() = delete;
 | 
					        Equipments() = delete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -110,18 +112,21 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::uint32_t add_damage() const noexcept final;
 | 
					        [[nodiscard]] std::uint32_t add_damage() const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::int32_t add_materiel(const characteristic::characType &inType) const noexcept final;
 | 
					        [[nodiscard]] std::int32_t add_materiel(const characteristic::characType inType) const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
					        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
					        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private:
 | 
				
			||||||
 | 
					        explicit Equipments(const equipments type) : type(type) {}
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    class Tools final : virtual public GenericObject {
 | 
					    class Tools final : virtual public GenericObject {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        const tools type{ tools::Fourche };
 | 
					        const tools type{ tools::Fourche };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        explicit Tools(const tools type) : type(type) {}
 | 
					        friend billyObjects new_object(const billyEnums &inputObject) noexcept;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Tools() = delete;
 | 
					        Tools() = delete;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,11 +138,14 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::uint32_t add_damage() const noexcept final;
 | 
					        [[nodiscard]] std::uint32_t add_damage() const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::int32_t add_materiel(const characteristic::characType &inType) const noexcept final;
 | 
					        [[nodiscard]] std::int32_t add_materiel(const characteristic::characType inType) const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
					        [[nodiscard]] std::string_view to_string() const noexcept final;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
					        [[nodiscard]] billyEnums get_type() const noexcept final { return type; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private:
 | 
				
			||||||
 | 
					        explicit Tools(const tools type) : type(type) {}
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // character
 | 
					} // character
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,10 @@
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
 | 
					// Created by postaron on 23/02/24.
 | 
				
			||||||
 | 
					//
 | 
				
			||||||
#include "billy_objects.hpp"
 | 
					#include "billy_objects.hpp"
 | 
				
			||||||
#include "characteristic.hpp"
 | 
					#include <spdlog/spdlog.h>
 | 
				
			||||||
 | 
					#include "characteristic/characteristic.hpp"
 | 
				
			||||||
#include "character_sheet.hpp"
 | 
					#include "character_sheet.hpp"
 | 
				
			||||||
#include <nlohmann/json.hpp>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
std::uint32_t constexpr const_hash(const char *input) {
 | 
					std::uint32_t constexpr const_hash(const char *input) {
 | 
				
			||||||
    return *input ? static_cast<unsigned int>(*input) + 33 * const_hash(input + 1) : 5381;
 | 
					    return *input ? static_cast<unsigned int>(*input) + 33 * const_hash(input + 1) : 5381;
 | 
				
			||||||
| 
						 | 
					@ -14,16 +17,10 @@ constexpr std::uint32_t toolsHash = const_hash("tools");
 | 
				
			||||||
namespace character {
 | 
					namespace character {
 | 
				
			||||||
    using characteristic::Characteristic;
 | 
					    using characteristic::Characteristic;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    bool BillyObjects::push_object(const billyObject &object, CharacterSheet &sheet) noexcept {
 | 
				
			||||||
    bool BillyObjects::insert_object(CharacterSheet &sheet, const billyEnums objType) noexcept {
 | 
					 | 
				
			||||||
        if (sheet.objects.size() < 3) {
 | 
					        if (sheet.objects.size() < 3) {
 | 
				
			||||||
            sheet.objects.emplace(objType, std::visit(overloaded{
 | 
					            sheet.objects.emplace_back(object);
 | 
				
			||||||
                    [](const weapons &arg) { return std::unique_ptr<GenericObject>(std::make_unique<Weapons>(arg)); },
 | 
					            sheet.available_objects.erase(object);
 | 
				
			||||||
                    [](const equipments &arg) { return std::unique_ptr<GenericObject>(std::make_unique<Equipments>(arg)); },
 | 
					 | 
				
			||||||
                    [](const tools &arg) { return std::unique_ptr<GenericObject>(std::make_unique<Tools>(arg)); },
 | 
					 | 
				
			||||||
            }, objType));
 | 
					 | 
				
			||||||
            const auto &object = sheet.objects[objType];
 | 
					 | 
				
			||||||
            sheet.available_objects.erase(objType);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
 | 
					            auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
 | 
				
			||||||
            auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
 | 
					            auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
 | 
				
			||||||
| 
						 | 
					@ -31,21 +28,42 @@ namespace character {
 | 
				
			||||||
            auto &local_chance = static_cast<Characteristic &>(sheet.chance);
 | 
					            auto &local_chance = static_cast<Characteristic &>(sheet.chance);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            std::visit(overloaded{
 | 
					            std::visit(overloaded{
 | 
				
			||||||
                    [&](const weapons &arg) { ++sheet.nb_weapons; },
 | 
					                    [&](const weapons &arg) {
 | 
				
			||||||
                    [&](const equipments &arg) { ++sheet.nb_equipments; },
 | 
					                        ++sheet.nb_weapons;
 | 
				
			||||||
                    [&](const tools &arg) { ++sheet.nb_tools; },
 | 
					                        change_carac_weapon(arg, sheet, local_habilete, local_adresse, local_endurance, plus);
 | 
				
			||||||
            }, objType);
 | 
					                    },
 | 
				
			||||||
            change_carac(object, sheet, local_habilete, local_adresse, local_endurance, local_chance, plus);
 | 
					                    [&](const equipments &arg) {
 | 
				
			||||||
 | 
					                        ++sheet.nb_equipments;
 | 
				
			||||||
 | 
					                        change_carac_equipment(arg,
 | 
				
			||||||
 | 
					                                sheet,
 | 
				
			||||||
 | 
					                                local_habilete,
 | 
				
			||||||
 | 
					                                local_adresse,
 | 
				
			||||||
 | 
					                                local_endurance,
 | 
				
			||||||
 | 
					                                local_chance,
 | 
				
			||||||
 | 
					                                plus,
 | 
				
			||||||
 | 
					                                minus);
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                    [&](const tools &arg) {
 | 
				
			||||||
 | 
					                        ++sheet.nb_tools;
 | 
				
			||||||
 | 
					                        change_carac_tools(arg,
 | 
				
			||||||
 | 
					                                sheet,
 | 
				
			||||||
 | 
					                                local_habilete,
 | 
				
			||||||
 | 
					                                local_adresse,
 | 
				
			||||||
 | 
					                                local_endurance,
 | 
				
			||||||
 | 
					                                local_chance,
 | 
				
			||||||
 | 
					                                plus);
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					            }, object);
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void BillyObjects::erase_object(CharacterSheet &sheet, const billyEnums objToErase) noexcept {
 | 
					    void BillyObjects::pop_object(CharacterSheet &sheet) noexcept {
 | 
				
			||||||
        if (!sheet.objects.empty()) {
 | 
					        if (!sheet.objects.empty()) {
 | 
				
			||||||
            const billyObjects obj{ sheet.objects[objToErase].release() };
 | 
					            const billyObject obj = sheet.objects.back();
 | 
				
			||||||
            sheet.objects.erase(objToErase);
 | 
					            sheet.objects.pop_back();
 | 
				
			||||||
            sheet.available_objects.insert(objToErase);
 | 
					            sheet.available_objects.insert(obj);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
 | 
					            auto &local_habilete = static_cast<Characteristic &>(sheet.habilete);
 | 
				
			||||||
            auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
 | 
					            auto &local_adresse = static_cast<Characteristic &>(sheet.adresse);
 | 
				
			||||||
| 
						 | 
					@ -53,49 +71,171 @@ namespace character {
 | 
				
			||||||
            auto &local_chance = static_cast<Characteristic &>(sheet.chance);
 | 
					            auto &local_chance = static_cast<Characteristic &>(sheet.chance);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            std::visit(overloaded{
 | 
					            std::visit(overloaded{
 | 
				
			||||||
                    [&](const weapons &arg) { --sheet.nb_weapons; },
 | 
					                    [&](const weapons &arg) {
 | 
				
			||||||
                    [&](const equipments &arg) { --sheet.nb_equipments; },
 | 
					                        --sheet.nb_weapons;
 | 
				
			||||||
                    [&](const tools &arg) { --sheet.nb_tools; }
 | 
					                        change_carac_weapon(arg, sheet, local_habilete, local_adresse, local_endurance, minus);
 | 
				
			||||||
            }, objToErase);
 | 
					                    },
 | 
				
			||||||
            change_carac(obj, sheet, local_habilete, local_adresse, local_endurance, local_chance, minus);
 | 
					                    [&](const equipments &arg) {
 | 
				
			||||||
 | 
					                        --sheet.nb_equipments;
 | 
				
			||||||
 | 
					                        change_carac_equipment(arg,
 | 
				
			||||||
 | 
					                                sheet,
 | 
				
			||||||
 | 
					                                local_habilete,
 | 
				
			||||||
 | 
					                                local_adresse,
 | 
				
			||||||
 | 
					                                local_endurance,
 | 
				
			||||||
 | 
					                                local_chance,
 | 
				
			||||||
 | 
					                                minus,
 | 
				
			||||||
 | 
					                                plus);
 | 
				
			||||||
 | 
					                    },
 | 
				
			||||||
 | 
					                    [&](const tools &arg) {
 | 
				
			||||||
 | 
					                        --sheet.nb_tools;
 | 
				
			||||||
 | 
					                        change_carac_tools(arg,
 | 
				
			||||||
 | 
					                                sheet,
 | 
				
			||||||
 | 
					                                local_habilete,
 | 
				
			||||||
 | 
					                                local_adresse,
 | 
				
			||||||
 | 
					                                local_endurance,
 | 
				
			||||||
 | 
					                                local_chance,
 | 
				
			||||||
 | 
					                                minus);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					            }, obj);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void BillyObjects::change_carac(const billyObjects &arg,
 | 
					    void BillyObjects::change_carac_tools(const tools &arg,
 | 
				
			||||||
            CharacterSheet &sheet,
 | 
					            CharacterSheet &sheet,
 | 
				
			||||||
            Characteristic &localHabilete,
 | 
					            Characteristic &localHabilete,
 | 
				
			||||||
            Characteristic &localAdresse,
 | 
					            Characteristic &localAdresse,
 | 
				
			||||||
            Characteristic &localEndurance,
 | 
					            Characteristic &localEndurance,
 | 
				
			||||||
            Characteristic &localChance,
 | 
					            Characteristic &localChance,
 | 
				
			||||||
            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) noexcept {
 | 
					            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) noexcept {
 | 
				
			||||||
        localHabilete.materiel = operation(localHabilete.materiel, arg->add_materiel(localHabilete.type));
 | 
					        switch (arg) {
 | 
				
			||||||
        localAdresse.materiel = operation(localAdresse.materiel, arg->add_materiel(localAdresse.type));
 | 
					            case tools::Fourche:
 | 
				
			||||||
        localEndurance.materiel = operation(localEndurance.materiel, arg->add_materiel(localEndurance.type));
 | 
					                localHabilete.materiel = operation(localHabilete.materiel, 1);
 | 
				
			||||||
        localChance.materiel = operation(localChance.materiel, arg->add_materiel(localChance.type));
 | 
					                localEndurance.materiel = operation(localEndurance.materiel, 3);
 | 
				
			||||||
        sheet.armor = operation(sheet.armor, arg->add_armor());
 | 
					                break;
 | 
				
			||||||
        sheet.damage = operation(sheet.armor, arg->add_damage());
 | 
					            case tools::Dagger:
 | 
				
			||||||
        sheet.critique = operation(sheet.critique, arg->add_critique());
 | 
					                sheet.critique = operation(sheet.critique, 6);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case tools::RockClimbingKit:
 | 
				
			||||||
 | 
					                localAdresse.materiel = operation(localAdresse.materiel, 1);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case tools::SackOfGrain:
 | 
				
			||||||
 | 
					                localEndurance.materiel = operation(localEndurance.materiel, 2);
 | 
				
			||||||
 | 
					                localChance.materiel = operation(localChance.materiel, 2);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    void BillyObjects::change_carac_equipment(const equipments &arg,
 | 
				
			||||||
 | 
					            CharacterSheet &sheet,
 | 
				
			||||||
 | 
					            Characteristic &localHabilete,
 | 
				
			||||||
 | 
					            Characteristic &localAdresse,
 | 
				
			||||||
 | 
					            Characteristic &localEndurance,
 | 
				
			||||||
 | 
					            Characteristic &localChance,
 | 
				
			||||||
 | 
					            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &primary,
 | 
				
			||||||
 | 
					            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &complement) noexcept {
 | 
				
			||||||
 | 
					        switch (arg) {
 | 
				
			||||||
 | 
					            case equipments::Chainmail:
 | 
				
			||||||
 | 
					                localHabilete.materiel = complement(localHabilete.materiel, 1);
 | 
				
			||||||
 | 
					                localAdresse.materiel = complement(localAdresse.materiel, 1);
 | 
				
			||||||
 | 
					                localEndurance.materiel = primary(localEndurance.materiel, 1);
 | 
				
			||||||
 | 
					                sheet.armor = primary(sheet.armor, 2);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case equipments::CookingPot:
 | 
				
			||||||
 | 
					                localEndurance.materiel = primary(localEndurance.materiel, 2);
 | 
				
			||||||
 | 
					                sheet.armor = primary(sheet.armor, 1);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case equipments::PamphletTourist:
 | 
				
			||||||
 | 
					                localChance.materiel = primary(localChance.materiel, 4);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case equipments::MedicKit:
 | 
				
			||||||
 | 
					                localChance.materiel = primary(localChance.materiel, 1);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    void BillyObjects::change_carac_weapon(const weapons &arg,
 | 
				
			||||||
 | 
					            CharacterSheet &sheet,
 | 
				
			||||||
 | 
					            Characteristic &localHabilete,
 | 
				
			||||||
 | 
					            Characteristic &localAdresse,
 | 
				
			||||||
 | 
					            Characteristic &localEndurance,
 | 
				
			||||||
 | 
					            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) noexcept {
 | 
				
			||||||
 | 
					        switch (arg) {
 | 
				
			||||||
 | 
					            case weapons::Sword:
 | 
				
			||||||
 | 
					                localHabilete.materiel = operation(localHabilete.materiel, 4);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case weapons::Lance:
 | 
				
			||||||
 | 
					                localHabilete.materiel = operation(localHabilete.materiel, 3);
 | 
				
			||||||
 | 
					                localAdresse.materiel = operation(localAdresse.materiel, 1);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case weapons::Morgenstern:
 | 
				
			||||||
 | 
					                localHabilete.materiel = operation(localHabilete.materiel, 1);
 | 
				
			||||||
 | 
					                localEndurance.materiel = operation(localEndurance.materiel, 1);
 | 
				
			||||||
 | 
					                sheet.damage = operation(sheet.damage, 1);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					            case weapons::Bow:
 | 
				
			||||||
 | 
					                localHabilete.materiel = operation(localHabilete.materiel, 3);
 | 
				
			||||||
 | 
					                localAdresse.materiel = operation(localAdresse.materiel, 1);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void BillyObjects::check_dagger_conditions(const CharacterSheet &sheet,
 | 
					    void BillyObjects::check_dagger_conditions(const CharacterSheet &sheet,
 | 
				
			||||||
            Characteristic &localHabilete,
 | 
					            Characteristic &localHabilete,
 | 
				
			||||||
            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) {
 | 
					            const std::function<std::uint32_t(std::uint32_t, std::uint32_t)> &operation) {
 | 
				
			||||||
        if (const auto it_dagger = sheet.objects.find(tools::Dagger); it_dagger != sheet.objects.cend()) {
 | 
					        int count_weapons = 0;
 | 
				
			||||||
            const std::size_t count_weapons = std::count_if(sheet.objects.cbegin(),
 | 
					        bool is_there_bow = false;
 | 
				
			||||||
                    sheet.objects.cend(),
 | 
					        std::for_each(sheet.objects.cbegin(), sheet.objects.cend(), [&](const billyObject &object) -> void {
 | 
				
			||||||
                    [](container::const_reference node) {
 | 
					            if (const weapons *p = std::get_if<weapons>(std::addressof(object)); p != nullptr) {
 | 
				
			||||||
                        return std::get_if<weapons>(&node.first) != nullptr;
 | 
					                ++count_weapons;
 | 
				
			||||||
                    });
 | 
					                if (*p == weapons::Bow) {
 | 
				
			||||||
            const bool is_there_bow = sheet.objects.find(weapons::Bow) != sheet.objects.cend();
 | 
					                    is_there_bow = true;
 | 
				
			||||||
            if (count_weapons > 1 || is_there_bow) {
 | 
					                }
 | 
				
			||||||
                localHabilete.materiel = operation(localHabilete.materiel,
 | 
					 | 
				
			||||||
                        -it_dagger->second->add_materiel(localHabilete.type));
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					        if (count_weapons < 2 && !is_there_bow) {
 | 
				
			||||||
 | 
					            localHabilete.materiel = operation(localHabilete.materiel, 1);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::string_view BillyObjects::billy_object_to_string(const billyObjects &object) noexcept {
 | 
					    std::string_view BillyObjects::billy_object_to_string(const billyObject &object) noexcept {
 | 
				
			||||||
        return object->to_string();
 | 
					        return std::visit(overloaded{
 | 
				
			||||||
 | 
					                [](const weapons &arg) {
 | 
				
			||||||
 | 
					                    switch (arg) {
 | 
				
			||||||
 | 
					                        case weapons::Sword:
 | 
				
			||||||
 | 
					                            return sword;
 | 
				
			||||||
 | 
					                        case weapons::Lance:
 | 
				
			||||||
 | 
					                            return lance;
 | 
				
			||||||
 | 
					                        case weapons::Morgenstern:
 | 
				
			||||||
 | 
					                            return morgenstern;
 | 
				
			||||||
 | 
					                        case weapons::Bow:
 | 
				
			||||||
 | 
					                            return bow;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                [](const equipments &arg) {
 | 
				
			||||||
 | 
					                    switch (arg) {
 | 
				
			||||||
 | 
					                        case equipments::Chainmail:
 | 
				
			||||||
 | 
					                            return chainmail;
 | 
				
			||||||
 | 
					                        case equipments::CookingPot:
 | 
				
			||||||
 | 
					                            return cooking_pot;
 | 
				
			||||||
 | 
					                        case equipments::MedicKit:
 | 
				
			||||||
 | 
					                            return medic_kit;
 | 
				
			||||||
 | 
					                        case equipments::PamphletTourist:
 | 
				
			||||||
 | 
					                            return pamphlet_tourist;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                [](const tools &arg) {
 | 
				
			||||||
 | 
					                    switch (arg) {
 | 
				
			||||||
 | 
					                        case tools::Fourche:
 | 
				
			||||||
 | 
					                            return fourche;
 | 
				
			||||||
 | 
					                        case tools::Dagger:
 | 
				
			||||||
 | 
					                            return dagger;
 | 
				
			||||||
 | 
					                        case tools::RockClimbingKit:
 | 
				
			||||||
 | 
					                            return rock_climbing_kit;
 | 
				
			||||||
 | 
					                        case tools::SackOfGrain:
 | 
				
			||||||
 | 
					                            return sack_of_grain;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					        }, object);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void BillyObjects::from_json(const json &j, BillyObjects::container &billy) {
 | 
					    void BillyObjects::from_json(const json &j, BillyObjects::container &billy) {
 | 
				
			||||||
| 
						 | 
					@ -104,21 +244,20 @@ namespace character {
 | 
				
			||||||
            const std::uint8_t value = element[1].get<std::uint8_t>();
 | 
					            const std::uint8_t value = element[1].get<std::uint8_t>();
 | 
				
			||||||
            switch (key) {
 | 
					            switch (key) {
 | 
				
			||||||
                case weaponsHash:
 | 
					                case weaponsHash:
 | 
				
			||||||
                    billy.emplace(static_cast<weapons>(value), std::make_unique<Weapons>(static_cast<weapons>(value)));
 | 
					                    billy.push_back(static_cast<weapons>(value));
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case equipmentHash:
 | 
					                case equipmentHash:
 | 
				
			||||||
                    billy.emplace(static_cast<equipments>(value),
 | 
					                    billy.push_back(static_cast<equipments>(value));
 | 
				
			||||||
                            std::make_unique<Equipments>(static_cast<equipments>(value)));
 | 
					 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case toolsHash:
 | 
					                case toolsHash:
 | 
				
			||||||
                    billy.emplace(static_cast<tools>(value), std::make_unique<Tools>(static_cast<tools>(value)));
 | 
					                    billy.push_back(static_cast<tools>(value));
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void BillyObjects::to_json(json &j, const BillyObjects::container &billy) {
 | 
					    void BillyObjects::to_json(json &j, const BillyObjects::container &billy) {
 | 
				
			||||||
        for (const auto &[object_type, _]: billy) {
 | 
					        for (const auto &object: billy) {
 | 
				
			||||||
            std::visit(overloaded{
 | 
					            std::visit(overloaded{
 | 
				
			||||||
                    [&j](const weapons weapon) {
 | 
					                    [&j](const weapons weapon) {
 | 
				
			||||||
                        j.emplace_back(std::pair{ weaponsHash, static_cast<std::uint8_t>(weapon) });
 | 
					                        j.emplace_back(std::pair{ weaponsHash, static_cast<std::uint8_t>(weapon) });
 | 
				
			||||||
| 
						 | 
					@ -129,7 +268,27 @@ namespace character {
 | 
				
			||||||
                    [&j](const tools tool) {
 | 
					                    [&j](const tools tool) {
 | 
				
			||||||
                        j.emplace_back(std::pair{ toolsHash, static_cast<std::uint8_t>(tool) });
 | 
					                        j.emplace_back(std::pair{ toolsHash, static_cast<std::uint8_t>(tool) });
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
            }, object_type);
 | 
					            }, object);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ankerl::svector<bool, 3> BillyObjects::check_conformity(const CharacterSheet &sheet) noexcept {
 | 
				
			||||||
 | 
					        ankerl::svector<bool, 3> output;
 | 
				
			||||||
 | 
					        std::transform(sheet.get_objects().cbegin(),
 | 
				
			||||||
 | 
					                sheet.get_objects().cend(), std::back_inserter(output),
 | 
				
			||||||
 | 
					                [&sheet](const billyObject &object) -> bool {
 | 
				
			||||||
 | 
					                    return std::visit(overloaded{
 | 
				
			||||||
 | 
					                            [](const weapons weapon) { return false; },
 | 
				
			||||||
 | 
					                            [](const equipments equipment) { return false; },
 | 
				
			||||||
 | 
					                            [](const tools tool) { return false; },
 | 
				
			||||||
 | 
					                    }, object);
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					        const int total = std::accumulate(sheet.get_objects().cbegin(),
 | 
				
			||||||
 | 
					                sheet.get_objects().cend(),
 | 
				
			||||||
 | 
					                0,
 | 
				
			||||||
 | 
					                [](const int a, const billyObject &object) -> int {
 | 
				
			||||||
 | 
					                    return 0;
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					        return output;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										1
									
								
								src/character_sheet.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								src/character_sheet.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					#include "character_sheet.hpp"
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,6 @@
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "generic_object.hpp"
 | 
					#include "generic_object.hpp"
 | 
				
			||||||
#include "characteristic.hpp"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace character {
 | 
					namespace character {
 | 
				
			||||||
    using characteristic::characType;
 | 
					    using characteristic::characType;
 | 
				
			||||||
| 
						 | 
					@ -31,7 +30,7 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::uint32_t Weapons::add_damage() const noexcept { return type == weapons::Morgenstern ? 1 : 0; }
 | 
					    std::uint32_t Weapons::add_damage() const noexcept { return type == weapons::Morgenstern ? 1 : 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::int32_t Weapons::add_materiel(const characteristic::characType &inType) const noexcept {
 | 
					    std::int32_t Weapons::add_materiel(const characteristic::characType inType) const noexcept {
 | 
				
			||||||
        switch (type) {
 | 
					        switch (type) {
 | 
				
			||||||
            case weapons::Sword:
 | 
					            case weapons::Sword:
 | 
				
			||||||
                if (inType == characType::Habilete) {
 | 
					                if (inType == characType::Habilete) {
 | 
				
			||||||
| 
						 | 
					@ -94,7 +93,7 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::uint32_t Equipments::add_damage() const noexcept { return 0; }
 | 
					    std::uint32_t Equipments::add_damage() const noexcept { return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::int32_t Equipments::add_materiel(const characteristic::characType &inType) const noexcept {
 | 
					    std::int32_t Equipments::add_materiel(const characteristic::characType inType) const noexcept {
 | 
				
			||||||
        switch (type) {
 | 
					        switch (type) {
 | 
				
			||||||
            case equipments::Chainmail:
 | 
					            case equipments::Chainmail:
 | 
				
			||||||
                if (inType == characType::Habilete ||
 | 
					                if (inType == characType::Habilete ||
 | 
				
			||||||
| 
						 | 
					@ -130,7 +129,7 @@ namespace character {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::uint32_t Tools::add_damage() const noexcept { return 0; }
 | 
					    std::uint32_t Tools::add_damage() const noexcept { return 0; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    std::int32_t Tools::add_materiel(const characteristic::characType &inType) const noexcept {
 | 
					    std::int32_t Tools::add_materiel(const characteristic::characType inType) const noexcept {
 | 
				
			||||||
        switch (type) {
 | 
					        switch (type) {
 | 
				
			||||||
            case tools::Fourche:
 | 
					            case tools::Fourche:
 | 
				
			||||||
                switch (inType) {
 | 
					                switch (inType) {
 | 
				
			||||||
| 
						 | 
					@ -166,4 +165,12 @@ namespace character {
 | 
				
			||||||
                return sackOfGrain;
 | 
					                return sackOfGrain;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    billyObjects new_object(const billyEnums &inputObject) noexcept {
 | 
				
			||||||
 | 
					        return std::visit(overloaded{
 | 
				
			||||||
 | 
					                [](const weapons input) { return billyObjects{ new Weapons{ input }}; },
 | 
				
			||||||
 | 
					                [](const equipments input) { return billyObjects{ new Equipments{ input }}; },
 | 
				
			||||||
 | 
					                [](const tools input) { return billyObjects{ new Tools{ input }}; }
 | 
				
			||||||
 | 
					        }, inputObject);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue