preparation of building asset structure
This commit is contained in:
@@ -3,7 +3,13 @@ use bevy::prelude::*;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use shared::identifiers::ResourceIdentifier;
|
||||
|
||||
use crate::footprint::BuildingFootprint;
|
||||
use crate::{
|
||||
buildings::{
|
||||
basic_building::BasicBuildingInfo, factory_building::FactoryBuildingInfo,
|
||||
resource_gathering::ResourceGatheringBuildingInfo,
|
||||
},
|
||||
footprint::BuildingFootprint,
|
||||
};
|
||||
|
||||
#[derive(Asset, TypePath, Debug, Serialize, Deserialize)]
|
||||
pub struct BuildingAsset {
|
||||
@@ -17,8 +23,25 @@ pub struct BuildingAsset {
|
||||
pub cost: Vec<ResourceIdentifier>,
|
||||
pub consumption: Vec<ResourceIdentifier>,
|
||||
pub production: Vec<ResourceIdentifier>,
|
||||
|
||||
pub health: u32,
|
||||
|
||||
pub building_type: BuildingType,
|
||||
pub animations: Vec<AnimationComponent>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, TypePath)]
|
||||
pub enum BuildingType {
|
||||
Basic,
|
||||
Gathering(ResourceGatheringBuildingInfo),
|
||||
FactoryBuildingInfo(FactoryBuildingInfo),
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Reflect)]
|
||||
pub enum AnimationComponent {
|
||||
Rotation,
|
||||
Slider,
|
||||
}
|
||||
create_asset_loader!(
|
||||
BuildingAssetPlugin,
|
||||
BuildingAssetLoader,
|
||||
|
||||
Reference in New Issue
Block a user