initial commit

This commit is contained in:
A 2023-04-10 18:31:02 -05:00
commit 8755548d08
233 changed files with 61286 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
/Debug
/KoraBotTests
/Release
/.vs

57
KoraBot.sln Normal file
View file

@ -0,0 +1,57 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30503.244
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KoraBot", "KoraBot.vcxproj", "{2E63AE74-758A-4607-9DE4-D28E814A6E13}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BWAPILIB", "..\BWAPILIB\BWAPILIB.vcxproj", "{843656FD-9BFD-47BF-8460-7BFE9710EA2C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KoraBotTests", "KoraBotTests\KoraBotTests.vcxproj", "{472D636A-6F55-49D1-856F-92C527D58ECC}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KoraBotTest", "KoraBotTest\KoraBotTest.vcxproj", "{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E63AE74-758A-4607-9DE4-D28E814A6E13}.Debug|x64.ActiveCfg = Debug|Win32
{2E63AE74-758A-4607-9DE4-D28E814A6E13}.Debug|x86.ActiveCfg = Debug|Win32
{2E63AE74-758A-4607-9DE4-D28E814A6E13}.Debug|x86.Build.0 = Debug|Win32
{2E63AE74-758A-4607-9DE4-D28E814A6E13}.Release|x64.ActiveCfg = Release|Win32
{2E63AE74-758A-4607-9DE4-D28E814A6E13}.Release|x86.ActiveCfg = Release|Win32
{2E63AE74-758A-4607-9DE4-D28E814A6E13}.Release|x86.Build.0 = Release|Win32
{843656FD-9BFD-47BF-8460-7BFE9710EA2C}.Debug|x64.ActiveCfg = Debug|Win32
{843656FD-9BFD-47BF-8460-7BFE9710EA2C}.Debug|x86.ActiveCfg = Debug|Win32
{843656FD-9BFD-47BF-8460-7BFE9710EA2C}.Debug|x86.Build.0 = Debug|Win32
{843656FD-9BFD-47BF-8460-7BFE9710EA2C}.Release|x64.ActiveCfg = Release|Win32
{843656FD-9BFD-47BF-8460-7BFE9710EA2C}.Release|x86.ActiveCfg = Release|Win32
{843656FD-9BFD-47BF-8460-7BFE9710EA2C}.Release|x86.Build.0 = Release|Win32
{472D636A-6F55-49D1-856F-92C527D58ECC}.Debug|x64.ActiveCfg = Debug|x64
{472D636A-6F55-49D1-856F-92C527D58ECC}.Debug|x64.Build.0 = Debug|x64
{472D636A-6F55-49D1-856F-92C527D58ECC}.Debug|x86.ActiveCfg = Debug|Win32
{472D636A-6F55-49D1-856F-92C527D58ECC}.Debug|x86.Build.0 = Debug|Win32
{472D636A-6F55-49D1-856F-92C527D58ECC}.Release|x64.ActiveCfg = Release|x64
{472D636A-6F55-49D1-856F-92C527D58ECC}.Release|x64.Build.0 = Release|x64
{472D636A-6F55-49D1-856F-92C527D58ECC}.Release|x86.ActiveCfg = Release|Win32
{472D636A-6F55-49D1-856F-92C527D58ECC}.Release|x86.Build.0 = Release|Win32
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Debug|x64.ActiveCfg = Debug|x64
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Debug|x64.Build.0 = Debug|x64
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Debug|x86.ActiveCfg = Debug|Win32
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Debug|x86.Build.0 = Debug|Win32
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Release|x64.ActiveCfg = Release|x64
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Release|x64.Build.0 = Release|x64
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Release|x86.ActiveCfg = Release|Win32
{E2B33FB7-A23E-4C7A-9A9D-02CCD70CFC56}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {71D7DBBD-1E53-43D6-B962-298144D4435C}
EndGlobalSection
EndGlobal

180
KoraBot.vcxproj Normal file
View file

@ -0,0 +1,180 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{2E63AE74-758A-4607-9DE4-D28E814A6E13}</ProjectGuid>
<RootNamespace>KoraBot</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(PlatformToolset)'=='v141_xp'">
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NOMINMAX;WIN32;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;_DEBUG;_WINDOWS;_USRDLL;KORABOT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<PreLinkEvent />
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NOMINMAX;WIN32;_WIN32_WINNT=0x0501;NTDDI_VERSION=0x05010300;NDEBUG;_WINDOWS;_USRDLL;KORABOT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<PreLinkEvent />
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Source\Analysis.cpp" />
<ClCompile Include="Source\BuildingPlacement.cpp" />
<ClCompile Include="Source\BWEM\EasyBMP_1.06\EasyBMP.cpp" />
<ClCompile Include="Source\BWEM\src\area.cpp" />
<ClCompile Include="Source\BWEM\src\base.cpp" />
<ClCompile Include="Source\BWEM\src\bwapiExt.cpp" />
<ClCompile Include="Source\BWEM\src\bwem.cpp" />
<ClCompile Include="Source\BWEM\src\cp.cpp" />
<ClCompile Include="Source\BWEM\src\examples.cpp" />
<ClCompile Include="Source\BWEM\src\exampleWall.cpp" />
<ClCompile Include="Source\BWEM\src\graph.cpp" />
<ClCompile Include="Source\BWEM\src\gridMap.cpp" />
<ClCompile Include="Source\BWEM\src\map.cpp" />
<ClCompile Include="Source\BWEM\src\mapDrawer.cpp" />
<ClCompile Include="Source\BWEM\src\mapImpl.cpp" />
<ClCompile Include="Source\BWEM\src\mapPrinter.cpp" />
<ClCompile Include="Source\BWEM\src\neutral.cpp" />
<ClCompile Include="Source\BWEM\src\tiles.cpp" />
<ClCompile Include="Source\BWEM\src\utils.cpp" />
<ClCompile Include="Source\BWEM\src\winutils.cpp" />
<ClCompile Include="Source\CBase.cpp" />
<ClCompile Include="Source\CheckItem.cpp" />
<ClCompile Include="Source\CPlayer.cpp" />
<ClCompile Include="Source\CUnit.cpp" />
<ClCompile Include="Source\Dll.cpp" />
<ClCompile Include="Source\KoraBot.cpp" />
<ClCompile Include="Source\Location.cpp" />
<ClCompile Include="Source\Macro.cpp" />
<ClCompile Include="Source\CMap.cpp" />
<ClCompile Include="Source\Military.cpp" />
<ClCompile Include="Source\Mining.cpp" />
<ClCompile Include="Source\PlayerAssessment.cpp" />
<ClCompile Include="Source\QueueEntry.cpp" />
<ClCompile Include="Source\Scouting.cpp" />
<ClCompile Include="Source\Squad.cpp" />
<ClCompile Include="Source\Util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Source\Analysis.h" />
<ClInclude Include="Source\BuildingPlacement.h" />
<ClInclude Include="Source\BWEM\EasyBMP_1.06\EasyBMP.h" />
<ClInclude Include="Source\BWEM\src\area.h" />
<ClInclude Include="Source\BWEM\src\base.h" />
<ClInclude Include="Source\BWEM\src\bwapiExt.h" />
<ClInclude Include="Source\BWEM\src\bwem.h" />
<ClInclude Include="Source\BWEM\src\cp.h" />
<ClInclude Include="Source\BWEM\src\defs.h" />
<ClInclude Include="Source\BWEM\src\examples.h" />
<ClInclude Include="Source\BWEM\src\exampleWall.h" />
<ClInclude Include="Source\BWEM\src\graph.h" />
<ClInclude Include="Source\BWEM\src\gridMap.h" />
<ClInclude Include="Source\BWEM\src\map.h" />
<ClInclude Include="Source\BWEM\src\mapDrawer.h" />
<ClInclude Include="Source\BWEM\src\mapImpl.h" />
<ClInclude Include="Source\BWEM\src\mapPrinter.h" />
<ClInclude Include="Source\BWEM\src\neutral.h" />
<ClInclude Include="Source\BWEM\src\tiles.h" />
<ClInclude Include="Source\BWEM\src\utils.h" />
<ClInclude Include="Source\BWEM\src\winutils.h" />
<ClInclude Include="Source\CBase.h" />
<ClInclude Include="Source\CheckItem.h" />
<ClInclude Include="Source\CPlayer.h" />
<ClInclude Include="Source\CUnit.h" />
<ClInclude Include="Source\KoraBot.h" />
<ClInclude Include="Source\Location.h" />
<ClInclude Include="Source\Macro.h" />
<ClInclude Include="Source\CMap.h" />
<ClInclude Include="Source\Military.h" />
<ClInclude Include="Source\Mining.h" />
<ClInclude Include="Source\PlayerAssessment.h" />
<ClInclude Include="Source\QueueEntry.h" />
<ClInclude Include="Source\Scouting.h" />
<ClInclude Include="Source\Squad.h" />
<ClInclude Include="Source\Util.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BWAPILIB\BWAPILIB.vcxproj">
<Project>{843656fd-9bfd-47bf-8460-7bfe9710ea2c}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

158
KoraBot.vcxproj.filters Normal file
View file

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="Source\Dll.cpp" />
<ClCompile Include="Source\KoraBot.cpp" />
<ClCompile Include="Source\BWEM\src\area.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\base.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\bwapiExt.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\bwem.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\cp.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\examples.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\exampleWall.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\graph.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\gridMap.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\map.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\mapDrawer.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\mapImpl.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\mapPrinter.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\neutral.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\utils.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\winutils.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\src\tiles.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\BWEM\EasyBMP_1.06\EasyBMP.cpp">
<Filter>BWEM</Filter>
</ClCompile>
<ClCompile Include="Source\Analysis.cpp" />
<ClCompile Include="Source\BuildingPlacement.cpp" />
<ClCompile Include="Source\CBase.cpp" />
<ClCompile Include="Source\CheckItem.cpp" />
<ClCompile Include="Source\CPlayer.cpp" />
<ClCompile Include="Source\CUnit.cpp" />
<ClCompile Include="Source\Location.cpp" />
<ClCompile Include="Source\Macro.cpp" />
<ClCompile Include="Source\Military.cpp" />
<ClCompile Include="Source\Mining.cpp" />
<ClCompile Include="Source\QueueEntry.cpp" />
<ClCompile Include="Source\Scouting.cpp" />
<ClCompile Include="Source\Squad.cpp" />
<ClCompile Include="Source\Util.cpp" />
<ClCompile Include="Source\PlayerAssessment.cpp" />
<ClCompile Include="Source\CMap.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Source\KoraBot.h" />
<ClInclude Include="Source\BWEM\src\area.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\base.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\bwem.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\bwapiExt.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\cp.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\defs.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\examples.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\exampleWall.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\graph.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\gridMap.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\map.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\mapDrawer.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\mapImpl.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\mapPrinter.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\neutral.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\winutils.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\utils.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\src\tiles.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\BWEM\EasyBMP_1.06\EasyBMP.h">
<Filter>BWEM</Filter>
</ClInclude>
<ClInclude Include="Source\Analysis.h" />
<ClInclude Include="Source\BuildingPlacement.h" />
<ClInclude Include="Source\CBase.h" />
<ClInclude Include="Source\CheckItem.h" />
<ClInclude Include="Source\CPlayer.h" />
<ClInclude Include="Source\CUnit.h" />
<ClInclude Include="Source\Location.h" />
<ClInclude Include="Source\Macro.h" />
<ClInclude Include="Source\Military.h" />
<ClInclude Include="Source\Mining.h" />
<ClInclude Include="Source\QueueEntry.h" />
<ClInclude Include="Source\Scouting.h" />
<ClInclude Include="Source\Squad.h" />
<ClInclude Include="Source\Util.h" />
<ClInclude Include="Source\PlayerAssessment.h" />
<ClInclude Include="Source\CMap.h" />
</ItemGroup>
<ItemGroup>
<Filter Include="BWEM">
<UniqueIdentifier>{dd2a7d56-7d9f-49ea-86d2-178e8c60dd0b}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

4
KoraBot.vcxproj.user Normal file
View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

View file

@ -0,0 +1,150 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Analysis.h";
using namespace BWAPI;
namespace AnalysisTest
{
BWAPI::UnitType drone = BWAPI::UnitTypes::Zerg_Drone;
BWAPI::TechType tech = BWAPI::TechTypes::Burrowing;
BWAPI::UpgradeType upgrade = BWAPI::UpgradeTypes::Zerg_Missile_Attacks;
TEST(AnalysisTest, analyzeTech)
{
EXPECT_EQ(Analysis::analyze(tech), 0);
}
TEST(AnalysisTest, DISABLED_analyzeUnit)
{
EXPECT_GE(Analysis::analyze(drone), 0);
}
TEST(AnalysisTest, analyzeUpgrade)
{
EXPECT_GE(Analysis::analyze(upgrade), 0);
}
TEST(AnalysisTest, DISABLED_analyzeDrone)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, DISABLED_analyzeEvoChamber)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, analyzeGas)
{
EXPECT_EQ(Analysis::analyzeGas(), 1);
}
TEST(AnalysisTest, analyzeGroundArmor)
{
EXPECT_EQ(Analysis::analyzeGroundArmor(), 1);
}
TEST(AnalysisTest, DISABLED_analyzeHatchery)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, analyzeHive)
{
EXPECT_EQ(Analysis::analyzeHive(), 0.8);
}
TEST(AnalysisTest, DISABLED_analyzeHydraDen)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, DISABLED_analyzeHydralisk)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, analyzeHydraRange)
{
EXPECT_EQ(Analysis::analyzeHydraRange(), 1);
}
TEST(AnalysisTest, analyzeHydraSpeed)
{
EXPECT_EQ(Analysis::analyzeHydraSpeed(), 1);
}
TEST(AnalysisTest, analyzeLair)
{
EXPECT_EQ(Analysis::analyzeLair(), 0.8);
}
TEST(AnalysisTest, analyzeLingSpeed)
{
EXPECT_EQ(Analysis::analyzeLingSpeed(), 1);
}
TEST(AnalysisTest, analyzeMissile)
{
EXPECT_EQ(Analysis::analyzeMissile(), 1);
}
TEST(AnalysisTest, DISABLED_analyzeMutalisk)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, DISABLED_analyzeOverlord)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, analyzeOverlordSpeed)
{
EXPECT_EQ(Analysis::analyzeOverlordSpeed(), 1);
}
TEST(AnalysisTest, analyzeQueensNest)
{
EXPECT_EQ(Analysis::analyzeQueensNest(), 1);
}
TEST(AnalysisTest, DISABLED_analyzeSpawningPool)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, analyzeSpire)
{
EXPECT_EQ(Analysis::analyzeSpire(), 1);
}
TEST(AnalysisTest, analyzeSpore)
{
EXPECT_EQ(Analysis::analyzeSpore(), 1);
}
TEST(AnalysisTest, analyzeSunken)
{
EXPECT_EQ(Analysis::analyzeSunken(), 1.3);
}
TEST(AnalysisTest, analyzeUltraCavern)
{
EXPECT_EQ(Analysis::analyzeUltraCavern(), 1);
}
TEST(AnalysisTest, DISABLED_analyzeUltralisk)
{
EXPECT_EQ(0, 0);
}
TEST(AnalysisTest, DISABLED_analyzeZergling)
{
EXPECT_EQ(0, 0);
}
}

View file

@ -0,0 +1,32 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Util.h";
using namespace BWAPI;
namespace BuildingPlacementTest
{
TEST(BuildingPlacementTest, DISABLED_build)
{
EXPECT_EQ(0, 0);
}
TEST(BuildingPlacementTest, DISABLED_checkBounds)
{
EXPECT_EQ(0, 0);
}
TEST(BuildingPlacementTest, DISABLED_getDirection)
{
EXPECT_EQ(0, 0);
}
TEST(BuildingPlacementTest, DISABLED_getPosition)
{
EXPECT_EQ(0, 0);
}
}

88
KoraBotTest/CBaseTest.cpp Normal file
View file

@ -0,0 +1,88 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Util.h";
using namespace BWAPI;
namespace CBaseTest
{
TEST(CBaseTest, DISABLED_addWorker)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_desiredSporeCount)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_desiredSunkenCount)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_extractorsBuilt)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_getDefense)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_getResources)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_initialize)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_initializeResources)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_isExposedToCenter)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_isSaturated)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_isStartLocation)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_setDefenseLocation)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_subtractWorker)
{
EXPECT_EQ(0, 0);
}
TEST(CBaseTest, DISABLED_techCount)
{
EXPECT_EQ(0, 0);
}
}
class MockCBase : public CBase
{
public:
};

46
KoraBotTest/CUnitTest.cpp Normal file
View file

@ -0,0 +1,46 @@
#include "pch.h"
#include <stdlib.h>
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h"
#include "../kora-bot/Source/CUnit.h"
using namespace BWAPI;
namespace CUnitTest
{
TEST(CUnitTest, initializeBlank)
{
CUnit unit = CUnit();
EXPECT_EQ(unit.action, "");
EXPECT_EQ(unit.lastSeen, TilePosition(0,0));
EXPECT_EQ(unit.miningBase, -1);
EXPECT_EQ(unit.target, TilePosition(-1, -1));
}
TEST(CUnitTest, DISABLED_initializeExistingUnit)
{
//MockBWAPIUnit BWAPIUnit;
//CUnit unit = CUnit(BWAPIUnit);
}
TEST(CUnitTest, DISABLED_isIdle)
{
EXPECT_EQ(0, 0);
}
TEST(CUnitTest, DISABLED_isInSquad)
{
EXPECT_EQ(0, 0);
}
}
class MockBWAPIUnit : public UnitInterface
{
public:
// in the same order they are in the BWAPI::UnitInterface definition
MOCK_METHOD(int, getID, (), (const, override));
MOCK_METHOD(bool, exists, (), (const, override));
};

View file

@ -0,0 +1,142 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Util.h";
using namespace BWAPI;
namespace CheckItemTest
{
TEST(CheckItemTest, DISABLED_checkBases)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkEvoChamber)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkGas)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkHive)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkHydraDen)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkHydralisk)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkMacroHatch)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkMutalisk)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkNewBase)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkQueensNest)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkSpawningPool)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkSpire)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkSpore)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkSunken)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkSupply)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkWorkers)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkUltraCavern)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkUltralisk)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkZergling)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkHydraRange)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkHydraSpeed)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkLair)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkLingSpeed)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkOverlordSpeed)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkGroundArmor)
{
EXPECT_EQ(0, 0);
}
TEST(CheckItemTest, DISABLED_checkMissile)
{
EXPECT_EQ(0, 0);
}
}

View file

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{e2b33fb7-a23e-4c7a-9a9d-02ccd70cfc56}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<ItemGroup>
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\packages\gmock.1.11.0\lib\native\src\gtest\src\gtest_main.cc" />
<ClCompile Include="AnalysisTest.cpp" />
<ClCompile Include="BuildingPlacementTest.cpp" />
<ClCompile Include="CBaseTest.cpp" />
<ClCompile Include="CheckItemTest.cpp" />
<ClCompile Include="CUnitTest.cpp" />
<ClCompile Include="MacroTest.cpp" />
<ClCompile Include="MilitaryTest.cpp" />
<ClCompile Include="MiningTest.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="PlayerAssessmentTest.cpp" />
<ClCompile Include="QueueEntryTest.cpp" />
<ClCompile Include="ScoutingTest.cpp" />
<ClCompile Include="SquadTest.cpp" />
<ClCompile Include="UtilTest.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\BWAPILIB\BWAPILIB.vcxproj">
<Project>{843656fd-9bfd-47bf-8460-7bfe9710ea2c}</Project>
</ProjectReference>
<ProjectReference Include="..\KoraBot.vcxproj">
<Project>{2e63ae74-758a-4607-9de4-d28e814a6e13}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemDefinitionGroup />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\gmock.1.11.0\build\native\gmock.targets" Condition="Exists('..\packages\gmock.1.11.0\build\native\gmock.targets')" />
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>../../include;$(SolutionDir)Release\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(SolutionDir)$(IntDir)*.obj;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(SolutionDir)$(IntDir)*.obj;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>../../include;$(SolutionDir)Release\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(SolutionDir)$(IntDir)*.obj;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(SolutionDir)$(IntDir)*.obj;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>../../include;$(SolutionDir)Release\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalLibraryDirectories>$(SolutionDir)$(IntDir)*.obj;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(SolutionDir)$(IntDir)*.obj;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<AdditionalIncludeDirectories>../../include;$(SolutionDir)Release\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<AdditionalLibraryDirectories>$(SolutionDir)$(IntDir)*.obj;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>$(SolutionDir)$(IntDir)*.obj;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\gmock.1.11.0\build\native\gmock.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\gmock.1.11.0\build\native\gmock.targets'))" />
</Target>
</Project>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>

228
KoraBotTest/MacroTest.cpp Normal file
View file

@ -0,0 +1,228 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Macro.h";
using namespace BWAPI;
namespace MacroTest
{
namespace { auto& map = BWEM::Map::Instance(); }
int selfID = 1;
TilePosition tp1 = TilePosition(1, 1);
TEST(MacroTest, DISABLED_addBase)
{
EXPECT_EQ(int(Macro::bases.size()), 0);
Macro::addBase(tp1);
EXPECT_EQ(int(Macro::bases.size()), 1);
}
TEST(MacroTest, addLocation)
{
EXPECT_EQ(int(Macro::locations.size()), 0);
Macro::addLocation(tp1, false);
EXPECT_EQ(int(Macro::locations.size()), 1);
}
TEST(MacroTest, addPlayer)
{
BWAPI::Player p = BWAPI::Player();
EXPECT_EQ(int(Macro::players.size()), 0);
Macro::addPlayer(p);
EXPECT_EQ(int(Macro::players.size()), 1);
}
TEST(MacroTest, addSquad)
{
EXPECT_EQ(int(Macro::squads.size()), 0);
Macro::addSquad();
EXPECT_EQ(int(Macro::squads.size()), 1);
}
TEST(MacroTest, DISABLED_analyzeQueue)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_assignBase)
{
BWAPI::Player p = BWAPI::Player();
CBase c = CBase();
Macro::addPlayer(p);
Macro::assignBase(p->getID(), c);
EXPECT_EQ(int(Macro::players.front().bases.size()), 1);
}
TEST(MacroTest, DISABLED_findMiningBase)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_freeUnit)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_getTrainingBase)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_morphCreepColonies)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_onUnitComplete)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_onUnitCreate)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_onUnitDestroy)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_onUnitDiscover)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_onUnitMorph)
{
EXPECT_EQ(1, 0);
}
TEST(MacroTest, DISABLED_onUnitShow)
{
Unit u = Unit();
EXPECT_EQ(1, 0);
}
TEST(MacroTest, queueCount)
{
BWAPI::UnitType unit = BWAPI::UnitTypes::Zerg_Drone;
EXPECT_EQ(Macro::queueCount(unit), 0);
Macro::queue.push_back(QueueEntry(unit, false, 0.0));
Macro::queue.push_back(QueueEntry(unit, false, 0.0));
EXPECT_EQ(Macro::queueCount(unit), 2);
}
TEST(MacroTest, queueHasTech)
{
BWAPI::TechType tech = BWAPI::TechTypes::Burrowing;
EXPECT_FALSE(Macro::queueHas(tech));
Macro::queue.push_back(QueueEntry(tech, false, 0.0));
EXPECT_TRUE(Macro::queueHas(tech));
}
TEST(MacroTest, queueHasUnit)
{
Macro::queue.clear();
BWAPI::UnitType unit = BWAPI::UnitTypes::Zerg_Drone;
EXPECT_FALSE(Macro::queueHas(unit));
Macro::queue.push_back(QueueEntry(unit, false, 0.0));
EXPECT_TRUE(Macro::queueHas(unit));
}
TEST(MacroTest, queueHasUpgrade)
{
BWAPI::UpgradeType upgrade = BWAPI::UpgradeTypes::Adrenal_Glands;
EXPECT_FALSE(Macro::queueHas(upgrade));
Macro::queue.push_back(QueueEntry(upgrade, false, 0.0));
EXPECT_TRUE(Macro::queueHas(upgrade));
}
TEST(MacroTest, setEnemyId)
{
int enemyId = 2;
Macro::setEnemyID(enemyId);
// check if the enemy id is in the enemyIDs vector
EXPECT_TRUE(std::find(Macro::enemyIDs.begin(), Macro::enemyIDs.end(), enemyId) != Macro::enemyIDs.end());
}
TEST(MacroTest, DISABLED_setLastAttack)
{
int lastAttackFrame = 2;
Macro::setLastAttack(lastAttackFrame);
EXPECT_EQ(Macro::lastAttack, lastAttackFrame);
}
TEST(MacroTest, DISABLED_setLastBuildLocation)
{
Macro::setLastBuildLocation(tp1);
EXPECT_EQ(Macro::lastBuildLocation.x, tp1.x);
EXPECT_EQ(Macro::lastBuildLocation.y, tp1.y);
}
TEST(MacroTest, DISABLED_setMacroHatch)
{
Macro::setMacroHatch(false);
EXPECT_EQ(Macro::macroHatch, false);
Macro::setMacroHatch(true);
EXPECT_EQ(Macro::macroHatch, true);
}
TEST(MacroTest, DISABLED_setNewBase)
{
Macro::setNewBase(false);
EXPECT_EQ(Macro::newBase, false);
Macro::setNewBase(true);
EXPECT_EQ(Macro::newBase, true);
}
TEST(MacroTest, DISABLED_setScouts)
{
EXPECT_EQ(int(Macro::scouts.size()), 0);
Macro::setSelfID(selfID);
CUnit overlord = CUnit();
Unit u = Unit();
}
TEST(MacroTest, setSelfID)
{
Macro::setSelfID(selfID);
EXPECT_EQ(Macro::selfID, selfID);
}
TEST(MacroTest, setStopProduction)
{
Macro::setStopProduction(false);
EXPECT_EQ(Macro::stopProduction, false);
Macro::setStopProduction(true);
EXPECT_EQ(Macro::stopProduction, true);
}
}
class MacroTestFixture : ::testing::Test
{
protected:
MacroTestFixture()
{
}
};

View file

@ -0,0 +1,87 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Util.h";
using namespace BWAPI;
namespace MilitaryTest
{
TEST(MilitaryTest, DISABLED_addSquadlessUnits)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_checkAttack)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_checkDefense)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_checkEnemiesAt)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_checkSquads)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_getAttackLocation)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_getBaseDefense)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_getClosestSquad)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_getIdleSquad)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_getMostVulnerableBase)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_inThreatRange)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_isThreatened)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_likelihoodToAttack)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_sendDefense)
{
EXPECT_EQ(0, 0);
}
TEST(MilitaryTest, DISABLED_shouldAttackNonMaxed)
{
EXPECT_EQ(0, 0);
}
}

View file

@ -0,0 +1,17 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Mining.h";
using namespace BWAPI;
namespace MiningTest
{
TEST(MiningTest, resourceToMine)
{
EXPECT_TRUE(Mining::resourceToMine());
}
}

View file

@ -0,0 +1,32 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/Util.h";
using namespace BWAPI;
namespace PlayerAssessmentTest
{
TEST(PlayerAssessmentTest, DISABLED_estimateBaseMinedMinerals)
{
EXPECT_EQ(0, 0);
}
TEST(PlayerAssessmentTest, DISABLED_estimateTotalGas)
{
EXPECT_EQ(0, 0);
}
TEST(PlayerAssessmentTest, DISABLED_estimateTotalMinerals)
{
EXPECT_EQ(0, 0);
}
TEST(PlayerAssessmentTest, DISABLED_estimateUnitCount)
{
EXPECT_EQ(0, 0);
}
}

View file

@ -0,0 +1,41 @@
#include "pch.h"
#pragma once
#include <BWAPI.h>
#include "../Source/BWEM/src/bwem.h";
#include "../Source/QueueEntry.h";
using namespace BWAPI;
namespace QueueEntryTest
{
BWAPI::TechType tech = BWAPI::TechTypes::Burrowing;
BWAPI::UnitType unit = BWAPI::UnitTypes::Zerg_Drone;
BWAPI::UpgradeType upgrade = BWAPI::UpgradeTypes::Zerg_Missile_Attacks;
QueueEntry techEntry = QueueEntry(tech, false, 0);
QueueEntry unitEntry = QueueEntry(unit, false, 0);
QueueEntry upgradeEntry = QueueEntry(upgrade, false, 0);
TEST(QueueEntryTest, isTech)
{
EXPECT_TRUE(techEntry.isTech());
EXPECT_FALSE(techEntry.isUnit());
EXPECT_FALSE(techEntry.isUpgrade());
}
TEST(QueueEntryTest, isUnit)
{
EXPECT_FALSE(unitEntry.isTech());
EXPECT_TRUE(unitEntry.isUnit());
EXPECT_FALSE(unitEntry.isUpgrade());
}
TEST(QueueEntryTest, isUpgrade)
{
EXPECT_FALSE(upgradeEntry.isTech());
EXPECT_FALSE(upgradeEntry.isUnit());
EXPECT_TRUE(upgradeEntry.isUpgrade());
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,20 @@
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\korabottest.pch
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\vc142.pdb
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\pch.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\utiltest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\squadtest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\scoutingtest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\queueentrytest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\playerassessmenttest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\miningtest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\militarytest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\macrotest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\cunittest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\checkitemtest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\cbasetest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\buildingplacementtest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\analysistest.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\gtest_main.obj
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\korabottest.tlog\cl.command.1.tlog
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\korabottest.tlog\cl.read.1.tlog
d:\_programs\starcraft-old\bwapi-4_4\kora-bot\korabottest\release\korabottest.tlog\cl.write.1.tlog

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>D:\_programs\Starcraft-old\BWAPI-4_4\kora-bot\Release\KoraBotTest.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs>
<NonRecipeFileRef>
<FullPath>D:\_programs\Starcraft-old\BWAPI-4_4\BWAPILIB\BWAPILIB.vcxproj</FullPath>
</NonRecipeFileRef>
<NonRecipeFileRef>
<FullPath>D:\_programs\Starcraft-old\BWAPI-4_4\kora-bot\KoraBot.vcxproj</FullPath>
</NonRecipeFileRef>
</NonRecipeFileRefs>
</Project>

View file

@ -0,0 +1,7 @@
 Analysis.obj : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
Creating library D:\_programs\Starcraft-old\BWAPI-4_4\kora-bot\Release\KoraBotTest.lib and object D:\_programs\Starcraft-old\BWAPI-4_4\kora-bot\Release\KoraBotTest.exp
BuildingPlacement.obj : error LNK2001: unresolved external symbol "public: static class BWEM::Map & __cdecl BWEM::Map::Instance(void)" (?Instance@Map@BWEM@@SAAAV12@XZ)
MacroTest.obj : error LNK2001: unresolved external symbol "public: static class BWEM::Map & __cdecl BWEM::Map::Instance(void)" (?Instance@Map@BWEM@@SAAAV12@XZ)
examples.obj : error LNK2001: unresolved external symbol "bool __cdecl BWEM::utils::seaSide(class BWAPI::Point<int,8>,class BWEM::Map const *)" (?seaSide@utils@BWEM@@YA_NV?$Point@H$07@BWAPI@@PBVMap@2@@Z)
Util.obj : error LNK2001: unresolved external symbol "public: static class BWAPI::Point<int,32> __cdecl Util::getAreaAverage(class BWEM::Area const *)" (?getAreaAverage@Util@@SA?AV?$Point@H$0CA@@BWAPI@@PBVArea@BWEM@@@Z)
D:\_programs\Starcraft-old\BWAPI-4_4\kora-bot\Release\KoraBotTest.exe : fatal error LNK1120: 3 unresolved externals

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,2 @@
PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=8.1: