14 if (!tileset_repo_->
exists(tileset_name)) {
20 auto maybe_tileset = tileset_repo_->
load(tileset_name);
21 if (!maybe_tileset.has_value()) {
23 FormattableError{fmt::format(
"failed to load tileset '{}'", tileset_name)}, maybe_tileset};
25 const auto tileset = std::move(maybe_tileset.value());
28 if (tileset->porytiles_component().is_empty()) {
34 if (!tileset->porymap_component().is_empty()) {
36 const auto mismatched_keys =
38 if (!mismatched_keys.empty()) {
40 FormattableError{
"unimported changes present in Porymap assets: TODO keys here"}};
53 auto maybe_new_tileset = compiler_->
compile(*tileset);
54 if (!maybe_new_tileset.has_value()) {
57 const auto new_tileset = std::move(maybe_new_tileset.value());
60 if (
const auto save_result = tileset_repo_->
save(*new_tileset); !save_result.has_value()) {
virtual std::vector< ArtifactKey > find_unsynced_tileset_artifacts(const std::string &tileset_name, const std::vector< ArtifactKey > &artifact_keys) const
Finds all artifacts for the given Tileset with unsynced changes compared to cached checksums.
virtual bool all_checksums_tileset_match(const std::string &tileset_name, const std::vector< ArtifactKey > &artifact_keys) const
Checks if all artifact checksums for the given Tileset match their cached values.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
ChainableResult< void > compile(const std::string &tileset_name) const
Compiles the primary Tileset with the given tileset name.
ChainableResult< std::unique_ptr< Tileset > > compile(const Tileset &tileset)
virtual std::vector< ArtifactKey > get_porymap_artifact_keys(const std::string &tileset_name) const
Gets the keys for all Porymap artifacts present in the given Tileset.
virtual std::vector< ArtifactKey > get_porytiles_artifact_keys(const std::string &tileset_name) const
Gets the keys for all Porytiles artifacts present in the given Tileset.
ChainableResult< void > save(const Tileset &tileset) const
Persists a given Tileset and caches new artifact checksums.
bool exists(const std::string &name) const
Checks if the given Tileset exists in the backing store.
ChainableResult< std::unique_ptr< Tileset > > load(const std::string &name) const
Loads an existing Tileset from storage.
const ArtifactChecksumProvider & checksum_provider() const
Gets a reference to the ArtifactChecksumProvider for this repo.
const TilesetArtifactKeyProvider & key_provider() const
Gets a reference to the TilesetArtifactKeyProvider for this repo.
@ bold
Bold text formatting.