在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:Blizzard/s2client-api开源软件地址:https://github.com/Blizzard/s2client-api开源编程语言:C++ 94.2%开源软件介绍:s2client-apiThe StarCraft II API provides access to in-game state observation and unit control. The API is a wrapper around protobuf defined protocol over a websocket connection. While it's possible to write directly to the protocol, this library provides a C++ and class-based abstraction. You can see a simple example below. #include <sc2api/sc2_api.h>
#include <iostream>
using namespace sc2;
class Bot : public Agent {
public:
virtual void OnGameStart() final {
std::cout << "Hello, World!" << std::endl;
}
virtual void OnStep() final {
std::cout << Observation()->GetGameLoop() << std::endl;
}
};
int main(int argc, char* argv[]) {
Coordinator coordinator;
coordinator.LoadSettings(argc, argv);
Bot bot;
coordinator.SetParticipants({
CreateParticipant(Race::Terran, &bot),
CreateComputer(Race::Zerg)
});
coordinator.LaunchStarcraft();
coordinator.StartGame(sc2::kMapBelShirVestigeLE);
while (coordinator.Update()) {
}
return 0;
} You can find a detailed tutorial on what this code does in docs/tutorial1.md. DocumentationYou can find API in documentation on our github pages site. The documentation is generated from code automatically, using Doxygen To editor and generate the documentation yourself.
BuildingThis library uses CMake to generate project files. It builds with Visual Studio on Windows and Makefiles on the other platforms. It relies on the following contrib packages.
Follow the instructions for submodules and building in docs/building.md. Coding StandardWe do our best to conform to the Google C++ Style Guide with the exception that we use four space tabs instead of two space tabs. Additional DownloadsMaps and ReplaysThis repository only comes with a few maps for testing. Additional maps and replays can be found here. Precompiled LibsIf you are using Visual Studio 2017 and just want precompiled library files you can download the following package: Other LibrariesAdditional community built AI libraries can be found here. If you are new to programming, the CommandCenter framework may be a good starting point. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论