use bevy states
despawn plugin buiding plugin
This commit is contained in:
@@ -5,5 +5,6 @@ pub mod heightmap;
|
||||
pub mod hex_utils;
|
||||
pub mod map;
|
||||
pub mod prelude;
|
||||
pub mod states;
|
||||
pub mod tile_manager;
|
||||
pub mod tile_mapper;
|
||||
|
||||
@@ -107,7 +107,7 @@ impl Map {
|
||||
|
||||
pub fn hex_select<OP, Ret>(&self, center: &HexCoord, radius: usize, include_center: bool, op: OP) -> Vec<Ret>
|
||||
where
|
||||
OP: Fn(&HexCoord, f32, usize) -> Ret + Sync + Send,
|
||||
OP: (Fn(&HexCoord, f32, usize) -> Ret) + Sync + Send,
|
||||
{
|
||||
assert!(radius != 0, "Radius cannot be zero");
|
||||
|
||||
@@ -140,7 +140,7 @@ impl Map {
|
||||
op: OP,
|
||||
) -> Vec<Ret>
|
||||
where
|
||||
OP: Fn(&HexCoord, &mut f32, usize) -> Ret + Sync + Send,
|
||||
OP: (Fn(&HexCoord, &mut f32, usize) -> Ret) + Sync + Send,
|
||||
{
|
||||
assert!(radius != 0, "Radius cannot be zero");
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@ pub use crate::map::chunk::*;
|
||||
pub use crate::map::config::*;
|
||||
pub use crate::map::map::*;
|
||||
pub use crate::map::mesh_chunk::*;
|
||||
pub use crate::states::*;
|
||||
|
||||
17
engine/world_generation/src/states.rs
Normal file
17
engine/world_generation/src/states.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use bevy::ecs::schedule::States;
|
||||
|
||||
#[derive(States, Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum GeneratorState {
|
||||
GenerateHeightmap,
|
||||
SpawnMap,
|
||||
Idle,
|
||||
Regenerate,
|
||||
}
|
||||
|
||||
#[derive(States, Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum AssetLoadState {
|
||||
StartLoading,
|
||||
Loading,
|
||||
FinalizeAssets,
|
||||
LoadComplete,
|
||||
}
|
||||
Reference in New Issue
Block a user