bevy_entitiles 0.4.0

A 2d tilemap library for bevy. With many useful algorithms/tools built in.
Documentation
use bevy::reflect::Reflect;
use serde::{Deserialize, Serialize};
use crate::prelude::TilemapAnimations;

use crate::tilemap::buffers::TileBuilderBuffer;

#[cfg(feature = "algorithm")]
use crate::tilemap::buffers::PathTileBuffer;
#[cfg(feature = "physics")]
use crate::tilemap::buffers::PackedPhysicsTileBuffer;

#[derive(Serialize, Deserialize, Debug, Clone, Reflect)]
pub struct TilemapPattern {
    pub(crate) label: Option<String>,
    pub(crate) tiles: TileBuilderBuffer,
    pub(crate) animations: TilemapAnimations,
    #[cfg(feature = "algorithm")]
    pub(crate) path_tiles: PathTileBuffer,
    #[cfg(feature = "physics")]
    pub(crate) physics_tiles: PackedPhysicsTileBuffer,
}

impl TilemapPattern {
    pub fn new(label: Option<String>) -> Self {
        Self {
            label,
            tiles: TileBuilderBuffer::new(),
            animations: Default::default(),
            #[cfg(feature = "algorithm")]
            path_tiles: PathTileBuffer::new(),
            #[cfg(feature = "physics")]
            physics_tiles: PackedPhysicsTileBuffer::new(),
        }
    }
}