buildings
This commit is contained in:
@@ -4,7 +4,7 @@ use shared::resource::ResourceIdentifier;
|
||||
|
||||
use crate::footprint::BuildingFootprint;
|
||||
|
||||
#[derive(Resource, Serialize, Deserialize)]
|
||||
#[derive(Asset, TypePath, Debug, Serialize, Deserialize)]
|
||||
pub struct BuildingAsset {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
|
||||
22
game/buildings/src/assets/building_database.rs
Normal file
22
game/buildings/src/assets/building_database.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use asset_loader::create_asset_loader;
|
||||
use bevy::prelude::{self, Resource};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::building_asset::BuildingAsset;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, TypePath, Asset)]
|
||||
pub struct BuildingDatabase {
|
||||
pub hq: u32,
|
||||
pub buildings_paths: Vec<String>,
|
||||
pub buildings: Vec<BuildingAsset>,
|
||||
}
|
||||
|
||||
create_asset_loader!(
|
||||
BuildingDatabasePlugin,
|
||||
BuildingDatabaseLoader,
|
||||
BuildingDatabase,
|
||||
BuildingDatabaseState,
|
||||
&["building.db.json"],;
|
||||
buildings_paths -> buildings
|
||||
?
|
||||
);
|
||||
@@ -1 +1,2 @@
|
||||
pub mod building_asset;
|
||||
pub mod building_database;
|
||||
|
||||
Reference in New Issue
Block a user