Porytiles
Loading...
Searching...
No Matches
project_tileset_artifact_key_provider.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <optional>
5#include <string>
6#include <utility>
7
10
11namespace porytiles2 {
12
25 public:
26 explicit ProjectTilesetArtifactKeyProvider(std::filesystem::path project_root)
27 : project_root_{std::move(project_root)}
28 {
29 }
30
31 [[nodiscard]] ArtifactKey key_for(const std::string &tileset_name, const TilesetArtifact &artifact) const override;
32
33 [[nodiscard]] bool artifact_exists(const ArtifactKey &key) const override;
34
35 [[nodiscard]] bool tileset_exists(const std::string &tileset_name) const override;
36
37 [[nodiscard]] std::set<std::string> discover_porytiles_anims(const std::string &tileset_name) const override;
38
39 [[nodiscard]] std::set<int>
40 discover_porytiles_anim_frames(const std::string &tileset_name, const std::string &anim_name) const override;
41
42 [[nodiscard]] std::set<std::string> discover_porymap_anims(const std::string &tileset_name) const override;
43
44 [[nodiscard]] std::set<int>
45 discover_porymap_anim_frames(const std::string &tileset_name, const std::string &anim_name) const override;
46
58 [[nodiscard]] std::filesystem::path tileset_root(const std::string &tileset_name) const;
59
60 private:
61 std::filesystem::path project_root_;
62
63 // TODO: implement configurable override paths for users who have changed the pokeemerald project structure
64 // std::optional<std::filesystem::path> behaviors_header_override_path_;
65 // std::optional<std::string> behaviors_header_override_file_;
66};
67
68} // namespace porytiles2
A type-safe wrapper for artifact keys.
Provides a pokeemerald project filesystem-based implementation for TilesetArtifactKeyProvider.
std::set< std::string > discover_porytiles_anims(const std::string &tileset_name) const override
Discovers the names of all Porytiles animations available for a tileset.
std::filesystem::path tileset_root(const std::string &tileset_name) const
Returns the filesystem path to the root directory of a tileset.
ArtifactKey key_for(const std::string &tileset_name, const TilesetArtifact &artifact) const override
Constructs a key for a given tileset artifact.
std::set< int > discover_porymap_anim_frames(const std::string &tileset_name, const std::string &anim_name) const override
Discovers the frame indices for a specific Porymap animation.
std::set< std::string > discover_porymap_anims(const std::string &tileset_name) const override
Discovers the names of all Porymap animations available for a tileset.
bool artifact_exists(const ArtifactKey &key) const override
Checks whether an artifact exists in the backing store for the given key.
std::set< int > discover_porytiles_anim_frames(const std::string &tileset_name, const std::string &anim_name) const override
Discovers the frame indices for a specific Porytiles animation.
bool tileset_exists(const std::string &tileset_name) const override
Checks whether a tileset exists in the backing store for the given tileset name.
Abstract interface for generating keys and discovering tileset artifacts in a backing store.
Represents a Pokémon Generation III decomp tileset artifact with type and optional metadata.