-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Yeet Resources, make it all entities
- Loading branch information
1 parent
0c4f973
commit 2d1d52d
Showing
14 changed files
with
84 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use bevy_ecs::{component::Component, entity::Entity, query::With, system::Single}; | ||
|
||
use crate::{prelude::Entropy, seed::RngSeed}; | ||
|
||
/// A marker component to signify a global source. Warning: there should only be **one** entity per | ||
/// PRNG type that qualifies as the `Global` source. | ||
#[derive(Debug, Component)] | ||
pub struct Global; | ||
|
||
/// A helper query to yield the [`Global`] source for a given [`bevy_prng::EntropySource`]. This returns the | ||
/// [`Entropy`] component to generate new random numbers from. | ||
pub type GlobalEntropy<'w, T> = Single<'w, &'static mut Entropy<T>, With<Global>>; | ||
|
||
/// A helper query to yield the [`Global`] source for a given [`EntropySource`]. This returns the | ||
/// [`RngSeed`] component to allow inspection to the initial seed for the source. | ||
pub type GlobalSeed<'w, T> = Single<'w, &'static RngSeed<T>, With<Global>>; | ||
|
||
/// A helper query to yield the [`Global`] source for a given [`EntropySource`]. This returns the | ||
/// [`Entity`] id to modify the source with via commands. | ||
pub type GlobalSource<'w, T> = Single<'w, Entity, (With<RngSeed<T>>, With<Global>)>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.