load("@rules_cc//cc:defs.bzl", "cc_library")
load("//tools:copts.bzl", "COPTS")

cc_library(
    name = "action_result_flatbuffer_helpers",
    hdrs = ["ActionResultFlatbufferHelpers.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok:__subpackages__",
        "//src/main/cpp/net/eagle0/shardok/library:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library:__subpackages__",
    ],
    deps = [
        "//src/main/flatbuffer/net/eagle0/shardok/storage:unit_cc_fbs",
        "//src/main/protobuf/net/eagle0/shardok/storage:action_result_cc_proto",
    ],
)

cc_library(
    name = "hex_cube_utils",
    srcs = ["HexCubeUtils.cpp"],
    hdrs = ["HexCubeUtils.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok:__subpackages__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library/map:coordinates",
    ],
)

cc_library(
    name = "hex_map_utils",
    srcs = ["HexMapUtils.cpp"],
    hdrs = ["HexMapUtils.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok:__subpackages__",
    ],
    deps = [
        ":hex_cube_utils",
        "//src/main/cpp/net/eagle0/common:filesystem_utils",
        "//src/main/cpp/net/eagle0/shardok/library/map:coordinates",
        "//src/main/cpp/net/eagle0/shardok/library/map:coords_set",
        "//src/main/cpp/net/eagle0/shardok/library/map:hex_map_direction",
        "//src/main/cpp/net/eagle0/shardok/library/settings:game_settings",
        "//src/main/flatbuffer/net/eagle0/shardok/storage:hex_map_cc_fbs",
        "//src/main/flatbuffer/net/eagle0/shardok/storage:unit_cc_fbs",
        "//src/main/protobuf/net/eagle0/shardok/api:unit_view_cc_proto",
    ],
)

cc_library(
    name = "meteor_range_coords",
    srcs = ["MeteorRangeCoords.cpp"],
    hdrs = ["MeteorRangeCoords.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/library:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library:__subpackages__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library/settings:game_settings",
        "//src/main/cpp/net/eagle0/shardok/library/util:hex_map_utils",
    ],
)

cc_library(
    name = "combat_utils",
    srcs = ["CombatUtils.cpp"],
    hdrs = ["CombatUtils.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/library:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library:__subpackages__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library/settings:game_settings",
        "//src/main/cpp/net/eagle0/shardok/library/unit",
        "//src/main/cpp/net/eagle0/shardok/library/util:action_result_flatbuffer_helpers",
        "//src/main/protobuf/net/eagle0/shardok/common:action_type_cc_proto",
        "//src/main/protobuf/net/eagle0/shardok/storage:action_result_cc_proto",
    ],
)

cc_library(
    name = "game_state_validator",
    srcs = ["GameStateValidator.cpp"],
    hdrs = ["GameStateValidator.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/library:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library:__subpackages__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library:game_state_w",
        "//src/main/cpp/net/eagle0/shardok/library:shardok_exception",
    ],
)

cc_library(
    name = "player_utils",
    srcs = ["PlayerUtils.cpp"],
    hdrs = ["PlayerUtils.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library/util:__pkg__",
    ],
    deps = [
        ":hex_map_utils",
        "//src/main/flatbuffer/net/eagle0/shardok/storage:game_state_cc_fbs",
    ],
)

cc_library(
    name = "weather_helpers",
    srcs = ["WeatherHelpers.cpp"],
    hdrs = ["WeatherHelpers.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/library:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library:__subpackages__",
    ],
    deps = [
        "//src/main/protobuf/net/eagle0/shardok/common:hex_map_direction_cc_proto",
        "//src/main/protobuf/net/eagle0/shardok/common:weather_cc_proto",
    ],
)

cc_library(
    name = "zone_of_control_calculator",
    srcs = ["ZoneOfControlCalculator.cpp"],
    hdrs = ["ZoneOfControlCalculator.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok/library:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok/library:__subpackages__",
    ],
    deps = [
        ":hex_map_utils",
        "//src/main/cpp/net/eagle0/shardok/library/settings:game_settings",
        "//src/main/cpp/net/eagle0/shardok/library/unit",
        "//src/main/protobuf/net/eagle0/shardok/api:unit_view_cc_proto",
    ],
)

cc_library(
    name = "game_state_dumper",
    srcs = ["GameStateDumper.cpp"],
    hdrs = ["GameStateDumper.hpp"],
    copts = COPTS,
    visibility = [
        "//src/main/cpp/net/eagle0/shardok:__subpackages__",
        "//src/test/cpp/net/eagle0/shardok:__subpackages__",
    ],
    deps = [
        "//src/main/cpp/net/eagle0/shardok/library:game_state_w",
        "//src/main/cpp/net/eagle0/shardok/library/fb_helpers:game_state_helpers",
    ],
)
