use bevy states

despawn plugin
buiding plugin
This commit is contained in:
2024-06-05 22:00:00 -04:00
parent c31c2fb908
commit 05f9fa3143
20 changed files with 296 additions and 54 deletions

View File

@@ -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;

View File

@@ -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");

View File

@@ -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::*;

View 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,
}