Skip to content

Commit

Permalink
Remove tree map header
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-johansson committed Aug 23, 2024
1 parent 8c82968 commit 6b8c59e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 29 deletions.
1 change: 0 additions & 1 deletion source/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ target_sources(tactile-base
INTERFACE FILE_SET "HEADERS" BASE_DIRS "inc" FILES
"inc/tactile/base/container/string.hpp"
"inc/tactile/base/container/string_map.hpp"
"inc/tactile/base/container/tree_map.hpp"
"inc/tactile/base/document/component_view.hpp"
"inc/tactile/base/document/document.hpp"
"inc/tactile/base/document/document_visitor.hpp"
Expand Down
13 changes: 0 additions & 13 deletions source/base/inc/tactile/base/container/tree_map.hpp

This file was deleted.

18 changes: 9 additions & 9 deletions source/core/inc/tactile/core/layer/tile_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

#pragma once

#include <concepts> // invocable
#include <optional> // optional
#include <concepts> // invocable
#include <functional> // less
#include <map> // map
#include <optional> // optional

#include "tactile/base/container/tree_map.hpp"
#include "tactile/base/id.hpp"
#include "tactile/base/io/byte_stream.hpp"
#include "tactile/base/prelude.hpp"
Expand All @@ -19,7 +20,7 @@

namespace tactile {

using SparseTileMatrix = TreeMap<MatrixIndex, TileID>;
using SparseTileMatrix = std::map<MatrixIndex, TileID, std::less<>>;

/**
* Base component for tile layers.
Expand Down Expand Up @@ -174,9 +175,8 @@ void set_layer_tile(Registry& registry,
* A tile identifier if successful; an empty optional otherwise.
*/
[[nodiscard]]
auto get_layer_tile(const Registry& registry,
EntityID layer_id,
const MatrixIndex& index) -> std::optional<TileID>;
auto get_layer_tile(const Registry& registry, EntityID layer_id, const MatrixIndex& index)
-> std::optional<TileID>;

/**
* Indicates whether a matrix index is within the interval [{0, 0}, {rows, columns}).
Expand All @@ -188,8 +188,8 @@ auto get_layer_tile(const Registry& registry,
* True if the index is within the region; false otherwise.
*/
[[nodiscard]]
auto is_index_within_extent(const MatrixExtent& extent,
const MatrixIndex& index) noexcept -> bool;
auto is_index_within_extent(const MatrixExtent& extent, const MatrixIndex& index) noexcept
-> bool;

/**
* Visits each tile in a tile layer within a given region.
Expand Down
7 changes: 4 additions & 3 deletions source/core/test/src/util/lookup_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

#include "tactile/core/util/lookup.hpp"

#include <functional> // less
#include <map> // map
#include <unordered_map> // unordered_map

#include <gtest/gtest.h>

#include "tactile/base/container/string.hpp"
#include "tactile/base/container/string_map.hpp"
#include "tactile/base/container/tree_map.hpp"
#include "tactile/core/debug/exception.hpp"

namespace tactile {
Expand All @@ -19,7 +20,7 @@ namespace tactile {
TEST(Lookup, EmptyMap)
{
const StringMap<int> hash_map {};
const TreeMap<String, int> tree_map {};
const std::map<String, int, std::less<>> tree_map {};

EXPECT_FALSE(exists_in(hash_map, "foo"));
EXPECT_FALSE(exists_in(tree_map, "foo"));
Expand All @@ -34,7 +35,7 @@ TEST(Lookup, EmptyMap)
/// \trace tactile::find_in
TEST(Lookup, FindIn)
{
TreeMap<int, String> map {};
std::map<int, String> map {};
map[0] = "0";
map[1] = "1";

Expand Down
5 changes: 2 additions & 3 deletions source/core/test/src/util/uuid_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

#include <algorithm> // count, count_if
#include <cctype> // isxdigit
#include <map> // map
#include <type_traits> // ...

#include <gtest/gtest.h>

#include "tactile/base/container/tree_map.hpp"

namespace tactile {

/**
Expand Down Expand Up @@ -101,7 +100,7 @@ TEST(UUID, LessThanOperator)
EXPECT_NO_THROW((void) (a < b));
EXPECT_NO_THROW((void) (b < a));

TreeMap<UUID, int> map {};
std::map<UUID, int> map {};
EXPECT_EQ(map.size(), 0);
EXPECT_FALSE(map.contains(a));
EXPECT_FALSE(map.contains(b));
Expand Down

0 comments on commit 6b8c59e

Please sign in to comment.