feat: add feature gate to ALL

This commit is contained in:
Anna 2018-03-29 14:41:25 -04:00
parent 0378603b64
commit be01721808
7 changed files with 10 additions and 1 deletions

View File

@ -4,7 +4,10 @@ version = "0.1.0"
authors = ["Kyle Clemens <git@kyleclemens.com>"] authors = ["Kyle Clemens <git@kyleclemens.com>"]
[features] [features]
default = ["jobs", "roles", "data_centers", "worlds"] default = ["jobs", "roles", "data_centers", "worlds", "all_const"]
# Every type
all_const = []
# Job-related # Job-related
jobs = ["combat_jobs", "non_combat_jobs", "job_classifications"] jobs = ["combat_jobs", "non_combat_jobs", "job_classifications"]

View File

@ -16,6 +16,7 @@ pub enum DataCenter {
} }
impl DataCenter { impl DataCenter {
#[cfg(feature = "all_const")]
pub const ALL: [DataCenter; 6] = [ pub const ALL: [DataCenter; 6] = [
DataCenter::Aether, DataCenter::Aether,
DataCenter::Chaos, DataCenter::Chaos,

View File

@ -20,6 +20,7 @@ pub enum Classification {
} }
impl Classification { impl Classification {
#[cfg(feature = "all_const")]
pub const ALL: [Classification; 4] = [ pub const ALL: [Classification; 4] = [
Classification::War, Classification::War,
Classification::Magic, Classification::Magic,

View File

@ -35,6 +35,7 @@ pub enum Job {
} }
impl Job { impl Job {
#[cfg(feature = "all_const")]
pub const ALL: [Job; 15] = [ pub const ALL: [Job; 15] = [
// DPS // DPS
Job::Bard, Job::Bard,

View File

@ -27,6 +27,7 @@ pub enum NonCombatJob {
} }
impl NonCombatJob { impl NonCombatJob {
#[cfg(feature = "all_const")]
pub const ALL: [NonCombatJob; 11] = [ pub const ALL: [NonCombatJob; 11] = [
NonCombatJob::Botanist, NonCombatJob::Botanist,
NonCombatJob::Fisher, NonCombatJob::Fisher,

View File

@ -18,6 +18,7 @@ pub enum Role {
} }
impl Role { impl Role {
#[cfg(feature = "all_const")]
pub const ALL: [Role; 3] = [Role::Dps, Role::Healer, Role::Tank]; pub const ALL: [Role; 3] = [Role::Dps, Role::Healer, Role::Tank];
pub fn as_str(&self) -> &'static str { pub fn as_str(&self) -> &'static str {

View File

@ -92,6 +92,7 @@ pub enum World {
} }
impl World { impl World {
#[cfg(feature = "all_const")]
pub const ALL: [World; 66] = [ pub const ALL: [World; 66] = [
// Aether // Aether
World::Adamantoise, World::Adamantoise,