save
Some checks failed
Rust Checks / checks (push) Failing after 10s

This commit is contained in:
CoCo_Sol 2024-03-13 06:56:49 +01:00
parent 64280ab3ff
commit 28dffe4ce9
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,57 @@
//! All programs related to the actions that you can do with all tiles.
use crate::map::Tile;
pub enum Action {
Build(u32),
Destroy(u32),
Recolt(u32),
Upgrade(u32),
VillageManagement,
TroopManagement,
}
impl Tile {
pub fn get_action(&self, index_of_tile: u8) -> Vec<Action> {
match *self {
Self::Breeding => [
Action::Destroy(index_of_tile),
Action::Upgrade(index_of_tile),
],
Self::Casern => [
Action::Destroy(index_of_tile),
Action::Upgrade(index_of_tile),
Action::TroopManagement,
],
Self::Castle => [
Action::Upgrade(index_of_tile),
Action::VillageManagement,
],
Self::Hill => [
Action::Recolt(index_of_tile),
],
Self::Grass => [
Action::Build(index_of_tile),
],
Self::Forest => [
Action::Recolt(index_of_tile),
],
Self::Mine => [
Action::Destroy(index_of_tile),
Action::Upgrade(index_of_tile),
],
Self::Outpost => [
Action::Destroy(index_of_tile),
],
Self::Sawmill => [
Action::Destroy(index_of_tile),
Action::Recolt(index_of_tile),
],
Self::Tower => [
Action::Destroy(index_of_tile),
Action::Upgrade(index_of_tile),
],
Self::Wall => [],
}
}
}

View file

@ -2,6 +2,7 @@
use bevy::prelude::*;
pub mod actions;
pub mod camera;
pub mod map;
pub mod responsive_scale;