building
This commit is contained in:
@@ -3,7 +3,13 @@ use bevy::prelude::*;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use shared::identifiers::ResourceIdentifier;
|
use shared::identifiers::ResourceIdentifier;
|
||||||
|
|
||||||
use crate::footprint::BuildingFootprint;
|
use crate::{
|
||||||
|
buildings::{
|
||||||
|
basic_building::BasicBuildingInfo, conduit_building::ResourceConduitInfo,
|
||||||
|
factory_building::FactoryBuildingInfo, resource_gathering::ResourceGatheringBuildingInfo,
|
||||||
|
},
|
||||||
|
footprint::BuildingFootprint,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Asset, TypePath, Debug, Serialize, Deserialize)]
|
#[derive(Asset, TypePath, Debug, Serialize, Deserialize)]
|
||||||
pub struct BuildingAsset {
|
pub struct BuildingAsset {
|
||||||
@@ -19,6 +25,19 @@ pub struct BuildingAsset {
|
|||||||
pub production: Vec<ResourceIdentifier>,
|
pub production: Vec<ResourceIdentifier>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, TypePath)]
|
||||||
|
pub enum BuildingType {
|
||||||
|
Basic,
|
||||||
|
Gathering(ResourceGatheringBuildingInfo),
|
||||||
|
FactoryBuildingInfo(FactoryBuildingInfo),
|
||||||
|
ResourceConduit(ResourceConduitInfo),
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Serialize, Deserialize, Debug, Reflect)]
|
||||||
|
pub enum AnimationComponent {
|
||||||
|
Rotation,
|
||||||
|
Slider,
|
||||||
|
}
|
||||||
create_asset_loader!(
|
create_asset_loader!(
|
||||||
BuildingAssetPlugin,
|
BuildingAssetPlugin,
|
||||||
BuildingAssetLoader,
|
BuildingAssetLoader,
|
||||||
|
|||||||
3
game/buildings/src/buildings/basic_building.rs
Normal file
3
game/buildings/src/buildings/basic_building.rs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct BasicBuildingInfo {}
|
||||||
6
game/buildings/src/buildings/conduit_building.rs
Normal file
6
game/buildings/src/buildings/conduit_building.rs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
#[derive(Serialize, Deserialize, Debug)]
|
||||||
|
pub struct ResourceConduitInfo {
|
||||||
|
pub range: usize,
|
||||||
|
pub connection_range: usize,
|
||||||
|
}
|
||||||
5
game/buildings/src/buildings/mod.rs
Normal file
5
game/buildings/src/buildings/mod.rs
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
pub mod resource_gathering;
|
||||||
|
pub mod basic_building;
|
||||||
|
pub mod factory_building;
|
||||||
|
pub mod tech_building;
|
||||||
|
pub mod conduit_building;
|
||||||
Submodule game/main/assets updated: 4082df18e0...7fa3e1fc9c
@@ -60,6 +60,7 @@ fn setup(mut commands: Commands, mut msaa: ResMut<Msaa>) {
|
|||||||
DepthPrepass,
|
DepthPrepass,
|
||||||
PhosOrbitCamera::default(),
|
PhosOrbitCamera::default(),
|
||||||
))
|
))
|
||||||
|
// .insert(RenderLayers::layer(0))
|
||||||
.insert(TemporalAntiAliasBundle::default());
|
.insert(TemporalAntiAliasBundle::default());
|
||||||
|
|
||||||
*msaa = Msaa::Off;
|
*msaa = Msaa::Off;
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ impl Plugin for PhosGamePlugin {
|
|||||||
MapInitPlugin,
|
MapInitPlugin,
|
||||||
RenderDistancePlugin,
|
RenderDistancePlugin,
|
||||||
BuildingPugin,
|
BuildingPugin,
|
||||||
|
// BuildUiPlugin,
|
||||||
UnitsPlugin,
|
UnitsPlugin,
|
||||||
DespawnPuglin,
|
DespawnPuglin,
|
||||||
TileSelectionPlugin,
|
TileSelectionPlugin,
|
||||||
|
|||||||
Reference in New Issue
Block a user