Initial Commit

This commit is contained in:
oupson 2022-08-14 17:32:01 +02:00
commit fd874bd15b
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
14 changed files with 140 additions and 0 deletions

38
.gitignore vendored Normal file
View File

@ -0,0 +1,38 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
build
cmake-build-*
bin
lib

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "Botcraft"]
path = Botcraft
url = https://github.com/adepierre/Botcraft.git

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

1
.idea/.name Normal file
View File

@ -0,0 +1 @@
AymDroid

2
.idea/AimDroid.iml Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

4
.idea/misc.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/AimDroid.iml" filepath="$PROJECT_DIR$/.idea/AimDroid.iml" />
</modules>
</component>
</project>

8
.idea/vcs.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Botcraft" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Botcraft/3rdparty/asio" vcs="Git" />
</component>
</project>

39
AymDroid/CMakeLists.txt Normal file
View File

@ -0,0 +1,39 @@
project(AymDroidBot)
# Declaring my source files
set(SRC_FILES
${PROJECT_SOURCE_DIR}/src/main.cpp
)
# Declaring my headers (this is not strictly
# necessary, but this will add them to the file
# structure in visual on windows)
set(HDR_FILES
${PROJECT_SOURCE_DIR}/include/main.hpp
)
# Create my target
add_executable(${PROJECT_NAME} ${HDR_FILES} ${SRC_FILES})
# Add my include folder to the include path
target_include_directories(${PROJECT_NAME} PUBLIC include)
# Linking my code to botcraft, cmake will handle everything
target_link_libraries(${PROJECT_NAME} botcraft)
# All this stuff is not really necessary, we just set the output folder
# to be the same than for botcraft so we don't need to manually copy the shared
# library next to the executable
set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "_d")
set_target_properties(${PROJECT_NAME} PROPERTIES RELWITHDEBINFO_POSTFIX "_rd")
if(MSVC)
# To avoid having one subfolder per configuration when building with Visual
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${BOTCRAFT_OUTPUT_DIR}/bin")
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${BOTCRAFT_OUTPUT_DIR}/bin")
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${BOTCRAFT_OUTPUT_DIR}/bin")
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${BOTCRAFT_OUTPUT_DIR}/bin")
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${BOTCRAFT_OUTPUT_DIR}/bin")
else()
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BOTCRAFT_OUTPUT_DIR}/bin")
endif(MSVC)

View File

@ -0,0 +1 @@
#pragma once

10
AymDroid/src/main.cpp Normal file
View File

@ -0,0 +1,10 @@
#include "botcraft/AI/SimpleBehaviourClient.hpp"
int main(int argc, char *argv[]) {
Botcraft::SimpleBehaviourClient client(true);
client.Connect(argv[1], argv[2], (argc > 3) ? argv[3] : "");
client.RunBehaviourUntilClosed();
client.Disconnect();
return 0;
}

1
Botcraft Submodule

@ -0,0 +1 @@
Subproject commit 26c71535a8e7b24419488961205474310bfdeb1a

16
CMakeLists.txt Normal file
View File

@ -0,0 +1,16 @@
cmake_minimum_required(VERSION 3.10)
project(AymDroid)
# Here we can set some values for botcraft options
# They will still appear in cmake_gui in windows
set(BOTCRAFT_BUILD_EXAMPLES OFF CACHE BOOL "")
# This will enter the Botcraft folder and
# process Botcrat/CMakeLists.txt to add its
# targets to our current project
add_subdirectory(Botcraft)
# This will enter our My_Code folder and
# process My_Code/CMakeLists.txt
add_subdirectory(AymDroid)

1
README.md Normal file
View File

@ -0,0 +1 @@
# AymDroid