1use crate::everything::Everything;
2use crate::scopes::Scopes;
3
4pub fn needs_prefix(arg: &str, data: &Everything, scopes: Scopes) -> Option<&'static str> {
6 use crate::item::Item;
7 if scopes == Scopes::AccoladeType && data.item_exists(Item::AccoladeType, arg) {
8 return Some("accolade_type");
9 }
10 if scopes == Scopes::ActivityType && data.item_exists(Item::ActivityType, arg) {
11 return Some("activity_type");
12 }
13 if scopes == Scopes::Character && data.item_exists(Item::Character, arg) {
14 return Some("character");
15 }
16 if scopes == Scopes::Culture && data.item_exists(Item::Culture, arg) {
17 return Some("culture");
18 }
19 if scopes == Scopes::CulturePillar && data.item_exists(Item::CulturePillar, arg) {
20 return Some("culture_pillar");
21 }
22 if scopes == Scopes::CultureTradition && data.item_exists(Item::CultureTradition, arg) {
23 return Some("culture_tradition");
24 }
25 if scopes == Scopes::Decision && data.item_exists(Item::Decision, arg) {
26 return Some("decision");
27 }
28 if scopes == Scopes::Doctrine && data.item_exists(Item::Doctrine, arg) {
29 return Some("doctrine");
30 }
31 if scopes == Scopes::Dynasty && data.item_exists(Item::Dynasty, arg) {
32 return Some("dynasty");
33 }
34 if scopes == Scopes::EpidemicType && data.item_exists(Item::EpidemicType, arg) {
35 return Some("epidemic_type");
36 }
37 if scopes == Scopes::Faith && data.item_exists(Item::Faith, arg) {
38 return Some("faith");
39 }
40 if scopes == Scopes::Flag {
41 return Some("flag");
42 }
43 if scopes == Scopes::GeographicalRegion && data.item_exists(Item::Region, arg) {
44 return Some("geographical_region");
45 }
46 if scopes == Scopes::GovernmentType && data.item_exists(Item::GovernmentType, arg) {
47 return Some("government_type");
48 }
49 if scopes == Scopes::HoldingType && data.item_exists(Item::HoldingType, arg) {
50 return Some("holding_type");
51 }
52 if scopes == Scopes::DynastyHouse && data.item_exists(Item::House, arg) {
53 return Some("house");
54 }
55 if scopes == Scopes::LegendType && data.item_exists(Item::LegendType, arg) {
56 return Some("legend_type");
57 }
58 if scopes == Scopes::Province && data.item_exists(Item::Province, arg) {
59 return Some("province");
60 }
61 if scopes == Scopes::Religion && data.item_exists(Item::Religion, arg) {
62 return Some("religion");
63 }
64 if scopes == Scopes::Struggle && data.item_exists(Item::Struggle, arg) {
65 return Some("struggle");
66 }
67 if scopes == Scopes::LandedTitle && data.item_exists(Item::Title, arg) {
68 return Some("title");
69 }
70 if scopes == Scopes::VassalContract && data.item_exists(Item::SubjectContract, arg) {
71 return Some("vassal_contract");
72 }
73 None
74}