-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f922336
commit b59190b
Showing
9 changed files
with
41 additions
and
6 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
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 |
---|---|---|
@@ -1,18 +1,35 @@ | ||
//! This module contains all map [Component]s definition. | ||
use bevy::{prelude::*, utils::HashMap}; | ||
|
||
/// [Component] holding Tiled world related settings. | ||
/// | ||
/// Controls various settings related to the way we handle the Tiled world. | ||
/// Must be added to the [Entity] holding the world. | ||
#[derive(Component, Default)] | ||
pub struct TiledWorldSettings { | ||
/// World chunking configuration | ||
/// | ||
/// If this value is None, we won't perform chunking: all maps from this world will just be loaded | ||
/// If this value is set, defines the area (in pixel) around each [Camera] where we should spawn a | ||
/// map if it overlaps with its associated [Rect]. | ||
pub chunking: Option<(u32, u32)>, | ||
} | ||
|
||
/// Marker [Component] for a Tiled world. | ||
#[derive(Component)] | ||
pub struct TiledWorldMarker; | ||
|
||
/// Marker [Component] to trigger a world respawn. | ||
/// | ||
/// Must be added to the [Entity] holding the map. | ||
#[derive(Component)] | ||
pub struct RespawnTiledWorld; | ||
|
||
/// [Component] storing informations about which maps are actually spawned | ||
#[derive(Component, Default)] | ||
pub struct TiledWorldStorage { | ||
/// Map using the map index from [super::asset::TiledWorld] maps list as key. | ||
/// It contains the map entity. | ||
pub spawned_maps: HashMap<usize, Entity>, | ||
} |
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