Porytiles
Loading...
Searching...
No Matches
create_primary_tileset.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <string>
5
10
11namespace porytiles2 {
12
17 public:
26 std::unique_ptr<TilesetRepo> tileset_repo,
27 std::unique_ptr<PrimaryTilesetCompiler> compiler,
28 std::unique_ptr<AssetGenerator> asset_generator)
29 : tileset_repo_{std::move(tileset_repo)}, compiler_{std::move(compiler)},
30 asset_generator_{std::move(asset_generator)}
31 {
32 }
33
40 [[nodiscard]] Result<void> create(const std::string &tileset_name) const;
41
42 private:
43 std::unique_ptr<TilesetRepo> tileset_repo_;
44 std::unique_ptr<PrimaryTilesetCompiler> compiler_;
45 std::unique_ptr<AssetGenerator> asset_generator_;
46};
47
48} // namespace porytiles2
Use case for creating a primary Tileset.
Result< void > create(const std::string &tileset_name) const
Creates the primary Tileset with the given tileset name.
CreatePrimaryTileset(std::unique_ptr< TilesetRepo > tileset_repo, std::unique_ptr< PrimaryTilesetCompiler > compiler, std::unique_ptr< AssetGenerator > asset_generator)
Constructs a CreatePrimaryTileset use case with the given repositories and services.
std::expected< T, E > Result
A result with some type T on success, otherwise an error of type E.
Definition result.hpp:25