Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
f091ff3254
|
|||
|
6f769757f3
|
|||
|
56055641c1
|
|||
|
64b92b009c
|
@@ -2,9 +2,10 @@ cmake_minimum_required(VERSION 3.18)
|
||||
project(PokemonScriptTester)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
option(WINDOWS "Whether the build target is Windows or not." OFF)
|
||||
set(STATICC TRUE)
|
||||
set(SHARED OFF)
|
||||
|
||||
include(CMakeLists.txt.in)
|
||||
include_pkmnlib()
|
||||
@@ -13,12 +14,17 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-fconcepts)
|
||||
endif ()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
add_link_options(-fuse-ld=lld)
|
||||
endif ()
|
||||
|
||||
|
||||
file(GLOB_RECURSE SRC_FILES src/*.cpp src/*.hpp)
|
||||
add_executable(PokemonScriptTester ${SRC_FILES})
|
||||
target_precompile_headers(PokemonScriptTester PUBLIC src/Precompiled.hxx)
|
||||
add_definitions(-DLEVEL_U8)
|
||||
|
||||
SET(_LINKS Arbutils CreatureLib pkmnLib -lpthread)
|
||||
SET(_LINKS -static pkmnLib)
|
||||
target_link_libraries(PokemonScriptTester PUBLIC ${_LINKS})
|
||||
target_compile_options(PokemonScriptTester PRIVATE -Wall -Wextra -Werror)
|
||||
|
||||
@@ -30,6 +36,6 @@ if (WINDOWS)
|
||||
add_compile_options(-m64)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-allow-multiple-definition")
|
||||
if (SHARED)
|
||||
set_target_properties(PokemonScriptTester PROPERTIES SUFFIX ".dll")
|
||||
set_target_properties(PokemonScriptTester PROPERTIES SUFFIX ".exe")
|
||||
endif(SHARED)
|
||||
endif (WINDOWS)
|
||||
Submodule src/BuildData updated: 85b80f4be7...d3e95dad61
@@ -5,6 +5,7 @@
|
||||
#include <CreatureLib/Battling/TurnChoices/PassTurnChoice.hpp>
|
||||
#include <PkmnLib/Battling/Battle/Battle.hpp>
|
||||
#include <PkmnLib/Battling/Pokemon/CreatePokemon.hpp>
|
||||
#include <PkmnLib/Battling/Pokemon/PokemonParty.hpp>
|
||||
#include <angelscript.h>
|
||||
#include "../TestEnvironment.hpp"
|
||||
|
||||
@@ -14,7 +15,7 @@ class BattleFunctions {
|
||||
TestEnvironment* env = static_cast<TestEnvironment*>(ctx->GetUserData());
|
||||
|
||||
auto lib = Globals::Library.GetValue();
|
||||
auto p1 = new CreatureLib::Battling::CreatureParty(species->GetSize());
|
||||
auto p1 = new PkmnLib::Battling::PokemonParty(species->GetSize());
|
||||
for (u32 i = 0; i < species->GetSize(); ++i) {
|
||||
auto s = reinterpret_cast<const ArbUt::StringView*>(species->At(i));
|
||||
auto mon1 = PkmnLib::Battling::CreatePokemon(lib, *s, level)
|
||||
@@ -43,7 +44,7 @@ class BattleFunctions {
|
||||
.WithGender(CreatureLib::Library::Gender::Male)
|
||||
.IsAllowedExperienceGain(false)
|
||||
.Build();
|
||||
auto p1 = new CreatureLib::Battling::CreatureParty(1);
|
||||
auto p1 = new PkmnLib::Battling::PokemonParty(1);
|
||||
p1->SwapInto(0, mon1);
|
||||
|
||||
auto mon2 = PkmnLib::Battling::CreatePokemon(lib, species2, level)
|
||||
@@ -53,7 +54,7 @@ class BattleFunctions {
|
||||
.WithGender(CreatureLib::Library::Gender::Male)
|
||||
.IsAllowedExperienceGain(false)
|
||||
.Build();
|
||||
auto p2 = new CreatureLib::Battling::CreatureParty(1);
|
||||
auto p2 = new PkmnLib::Battling::PokemonParty(1);
|
||||
p2->SwapInto(0, mon2);
|
||||
|
||||
auto battle = new PkmnLib::Battling::Battle(
|
||||
@@ -75,8 +76,8 @@ class BattleFunctions {
|
||||
return battle;
|
||||
}
|
||||
|
||||
static PkmnLib::Battling::Battle* CreateSimpleBattleFromParties(u32 seed, CreatureLib::Battling::CreatureParty* p1,
|
||||
CreatureLib::Battling::CreatureParty* p2) {
|
||||
static PkmnLib::Battling::Battle* CreateSimpleBattleFromParties(u32 seed, PkmnLib::Battling::PokemonParty* p1,
|
||||
PkmnLib::Battling::PokemonParty* p2) {
|
||||
auto* ctx = asGetActiveContext();
|
||||
TestEnvironment* env = static_cast<TestEnvironment*>(ctx->GetUserData());
|
||||
auto lib = Globals::Library.GetValue();
|
||||
@@ -91,7 +92,7 @@ class BattleFunctions {
|
||||
seed // with seed
|
||||
);
|
||||
battle->SwitchCreature(0, 0, p1->GetAtIndex(0));
|
||||
battle->SwitchCreature(1, 0, p2->GetAtIndex(1));
|
||||
battle->SwitchCreature(1, 0, p2->GetAtIndex(0));
|
||||
|
||||
env->AddGarbage(battle);
|
||||
return battle;
|
||||
|
||||
Reference in New Issue
Block a user