load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application")
load("//tools:copts.bzl", "COPTS")

cc_library(
    name = "action_point_distances",
    srcs = ["ActionPointDistances.cpp"],
    hdrs = ["ActionPointDistances.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/ai:__pkg__",
        "//src/test/cpp/net/eagle0/shardok/library/action_point_distances:__pkg__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library/fb_helpers:flatbuffer_wrapper",
        "//src/main/cpp/net/eagle0/shardok/library/fb_helpers:hex_map_helpers",
        "//src/main/cpp/net/eagle0/shardok/library/util:hex_map_utils",
    ],
)

cc_library(
    name = "action_point_distances_cache",
    srcs = ["ActionPointDistancesCache.cpp"],
    hdrs = ["ActionPointDistancesCache.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/ai:__pkg__",
        "//src/main/cpp/net/eagle0/shardok/ai/mcts:__pkg__",
        "//src/test/cpp/net/eagle0/shardok/library/action_point_distances:__pkg__",
    ],
    deps = [
        ":fixed_action_point_distances",
        "//src/main/cpp/net/eagle0/shardok/library/map:hex_map_hasher",
        "//src/main/protobuf/net/eagle0/shardok/storage:action_result_cc_proto",
        "@gtl",
    ],
)

cc_library(
    name = "fixed_action_point_distances",
    srcs = ["FixedActionPointDistances.cpp"],
    hdrs = ["FixedActionPointDistances.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/ai:__pkg__",
        "//src/main/cpp/net/eagle0/shardok/ai_battle_simulator:__pkg__",
        "//src/main/cpp/net/eagle0/shardok/ai_performance_runner:__pkg__",
        "//src/test/cpp/net/eagle0/shardok/library/action_point_distances:__pkg__",
    ],
    deps = [
        ":action_point_distances",
        "//src/main/cpp/net/eagle0/shardok/library/fb_helpers:flatbuffer_wrapper",
        "//src/main/cpp/net/eagle0/shardok/library/fb_helpers:hex_map_helpers",
    ],
)

cc_library(
    name = "fixed_action_point_distances_timer",
    srcs = ["FixedActionPointDistancesTimer.cpp"],
    copts = COPTS,
    data = [
        "//src/main/resources/net/eagle0/shardok/maps",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/common:sequence_random_generator",
        "//src/main/cpp/net/eagle0/shardok/library/action_point_distances:fixed_action_point_distances",
        "//src/main/cpp/net/eagle0/shardok/library/settings_loader",
        "//src/main/cpp/net/eagle0/shardok/util:map_loader",
        "@googletest//:gtest",
        "@googletest//:gtest_main",
    ],
)

cc_binary(
    name = "fixed_action_point_distances_timer_app",
    copts = COPTS,
    data = [
        "//src/main/resources/net/eagle0/shardok/maps",
    ],
    deps = [
        ":fixed_action_point_distances_timer",
    ],
)

macos_command_line_application(
    name = "fixed_action_point_distances_timer_macos_app",
    minimum_os_version = "10.15",
    deps = [
        ":fixed_action_point_distances_timer",
    ],
)
