Skip to content

Commit

Permalink
Merge pull request #44 from rparrett/xbundle
Browse files Browse the repository at this point in the history
Fix consistency with the XComponents -> XBundle refactor in bevy 0.4
  • Loading branch information
dmtaub authored Mar 20, 2021
2 parents 074c9db + 2fc6e1d commit 9d04a5f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
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

0 comments on commit 9d04a5f

Please sign in to comment.