use fforge_domain::{NUM_ROLES, Role};
pub const NUM_ZONES: usize = 5;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Zone {
Def,
Mid,
AttC,
AttW,
Box,
}
impl Zone {
#[inline]
pub const fn index(self) -> usize {
self as usize
}
pub fn label(self) -> &'static str {
match self {
Zone::Def => "deep in their own third",
Zone::Mid => "in midfield",
Zone::AttC => "in the final third",
Zone::AttW => "out wide",
Zone::Box => "in the box",
}
}
}
#[rustfmt::skip]
const PRES_ATT: [[u8; NUM_ZONES]; NUM_ROLES] = [
[5, 0, 0, 0, 0], [4, 1, 0, 0, 0], [3, 3, 1, 3, 0], [3, 4, 1, 0, 0], [1, 4, 3, 1, 1], [0, 3, 4, 2, 2], [0, 2, 2, 5, 2], [0, 1, 3, 1, 5], ];
#[rustfmt::skip]
const PRES_DEF: [[u8; NUM_ZONES]; NUM_ROLES] = [
[0, 0, 0, 0, 3], [1, 1, 4, 2, 5], [1, 2, 2, 5, 3], [2, 4, 3, 1, 1], [2, 4, 2, 1, 0], [2, 2, 1, 1, 0], [3, 2, 1, 2, 0], [4, 1, 0, 0, 0], ];
pub fn attacking_presence(role: Role, zone: Zone) -> u32 {
PRES_ATT[role.index()][zone.index()] as u32
}
pub fn defending_presence(role: Role, zone: Zone) -> u32 {
PRES_DEF[role.index()][zone.index()] as u32
}