Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix consistency with the XComponents -> XBundle refactor in bevy 0.4 #44

Merged
merged 1 commit into from
Mar 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/iso_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands
.spawn(bevy_tiled_prototype::TiledMapComponents {
.spawn(bevy_tiled_prototype::TiledMapBundle {
map_asset: asset_server.load("iso-map.tmx"),
center: TiledMapCenter(true),
origin: Transform::from_scale(Vec3::new(4.0, 4.0, 1.0)),
Expand Down
2 changes: 1 addition & 1 deletion examples/ortho_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands
.spawn(bevy_tiled_prototype::TiledMapComponents {
.spawn(bevy_tiled_prototype::TiledMapBundle {
map_asset: asset_server.load("ortho-map.tmx"),
center: TiledMapCenter(true),
origin: Transform::from_scale(Vec3::new(SCALE, SCALE, 1.0)),
Expand Down
2 changes: 1 addition & 1 deletion examples/ortho_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn main() {

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands
.spawn(bevy_tiled_prototype::TiledMapComponents {
.spawn(bevy_tiled_prototype::TiledMapBundle {
map_asset: asset_server.load("ortho-map.tmx"),
center: TiledMapCenter(true),
origin: Transform::from_scale(Vec3::new(4.0, 4.0, 1.0)),
Expand Down
2 changes: 1 addition & 1 deletion examples/parent_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
.current_entity();

commands
.spawn(bevy_tiled_prototype::TiledMapComponents {
.spawn(bevy_tiled_prototype::TiledMapBundle {
map_asset: asset_server.load("ortho-map.tmx"),
parent_option: parent,
center: TiledMapCenter(true),
Expand Down
10 changes: 5 additions & 5 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ impl Default for DebugConfig {

/// A bundle of tiled map entities.
#[derive(Bundle)]
pub struct TiledMapComponents {
pub struct TiledMapBundle {
pub map_asset: Handle<Map>,
pub parent_option: Option<Entity>,
pub materials: HashMap<u32, Handle<ColorMaterial>>,
Expand All @@ -639,7 +639,7 @@ pub struct TiledMapComponents {
pub created_entities: CreatedMapEntities,
}

impl Default for TiledMapComponents {
impl Default for TiledMapBundle {
fn default() -> Self {
Self {
map_asset: Handle::default(),
Expand All @@ -663,7 +663,7 @@ pub struct CreatedMapEntities {
}

#[derive(Bundle)]
pub struct ChunkComponents {
pub struct ChunkBundle {
pub map_parent: Handle<Map>, // tmp:chunks should be child entities of a toplevel map entity.
pub chunk: TileMapChunk,
pub main_pass: MainPass,
Expand All @@ -676,7 +676,7 @@ pub struct ChunkComponents {
pub global_transform: GlobalTransform,
}

impl Default for ChunkComponents {
impl Default for ChunkBundle {
fn default() -> Self {
Self {
map_parent: Handle::default(),
Expand Down Expand Up @@ -870,7 +870,7 @@ pub fn process_loaded_tile_maps(

// Instead for now spawn a new entity per chunk.
let chunk_entity = commands
.spawn(ChunkComponents {
.spawn(ChunkBundle {
chunk: TileMapChunk {
// TODO: Support more layers here..
layer_id: layer_id as f32,
Expand Down