Skip to content

Commit

Permalink
Merge pull request #32 from Leafwing-Studios/app-ext-yeet
Browse files Browse the repository at this point in the history
Rename AppExt to RegisterManifest
  • Loading branch information
sixfold-origami authored Apr 17, 2024
2 parents f12e71a + 3b349cb commit 94d72e3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/entities_from_manifests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use leafwing_manifest::{
asset_state::SimpleAssetState,
identifier::Id,
manifest::{Manifest, ManifestFormat},
plugin::{AppExt, ManifestPlugin},
plugin::{ManifestPlugin, RegisterManifest},
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion examples/raw_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use leafwing_manifest::{
asset_state::SimpleAssetState,
identifier::Id,
manifest::{Manifest, ManifestFormat},
plugin::{AppExt, ManifestPlugin},
plugin::{ManifestPlugin, RegisterManifest},
};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use leafwing_manifest::{
asset_state::SimpleAssetState,
identifier::Id,
manifest::{Manifest, ManifestFormat},
plugin::{AppExt, ManifestPlugin},
plugin::{ManifestPlugin, RegisterManifest},
};
use serde::{Deserialize, Serialize};

Expand Down
8 changes: 4 additions & 4 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ use crate::manifest::Manifest;
/// This plugin will add the required state to your app (starting in [`AssetLoadingState::LOADING`]),
/// and set up the required systems to progress through the asset loading process and parse any added manifests.
///
/// Note that manifests must be added to the app manually, using the [`app.register_manifest`](crate::plugin::AppExt::register_manifest) method.
/// Note that manifests must be added to the app manually, using the [`app.register_manifest`](crate::plugin::RegisterManifest::register_manifest) method.
/// This plugin **must** be added before manifests are registered.
///
/// While [`register_manifest`](crate::plugin::AppExt::register_manifest) must be called for each manifest type you wish to use,
/// While [`register_manifest`](crate::plugin::RegisterManifest::register_manifest) must be called for each manifest type you wish to use,
/// this plugin should only be added a single time.
///
/// This plugin is intenionally optional: if you have more complex asset loading requirements, take a look at the systems in this plugin and either add or reimplement them as needed.
Expand Down Expand Up @@ -71,7 +71,7 @@ impl<S: AssetLoadingState> Plugin for ManifestPlugin<S> {
}

/// An extension trait for registering manifests with an app.
pub trait AppExt {
pub trait RegisterManifest {
/// Registers a manifest with the app, preparing it for loading and parsing.
///
/// The final manifest type must implement [`Manifest`], while the raw manifest type must implement [`Asset`](bevy::asset::Asset).
Expand All @@ -87,7 +87,7 @@ pub trait AppExt {
#[derive(SystemSet, PartialEq, Eq, Hash, Debug, Clone)]
struct ProcessManifestSet;

impl AppExt for App {
impl RegisterManifest for App {
/// Registers the manifest `M`.
///
/// By default, the path root is the `assets` folder, just like all Bevy assets.
Expand Down

0 comments on commit 94d72e3

Please sign in to comment.