tiger_lib/imperator/
scopes.rs1use crate::everything::Everything;
2use crate::item::Item;
3use crate::scopes::Scopes;
4
5pub fn needs_prefix(arg: &str, data: &Everything, scopes: Scopes) -> Option<&'static str> {
6 if scopes == Scopes::Party && data.item_exists(Item::PartyType, arg) {
15 return Some("party");
16 }
17 if scopes == Scopes::Treasure && data.item_exists(Item::Treasure, arg) {
18 return Some("treasure");
19 }
20 if scopes == Scopes::Region && data.item_exists(Item::Region, arg) {
21 return Some("region");
22 }
23 if scopes == Scopes::Area && data.item_exists(Item::Area, arg) {
24 return Some("area");
25 }
26 if scopes == Scopes::Culture && data.item_exists(Item::Culture, arg) {
27 return Some("culture");
28 }
29 if scopes == Scopes::Deity && data.item_exists(Item::Deity, arg) {
30 return Some("deity");
31 }
32 if scopes == Scopes::Country {
33 return Some("c");
34 }
35 if scopes == Scopes::Religion && data.item_exists(Item::Religion, arg) {
36 return Some("religion");
37 }
38 if scopes == Scopes::Flag {
39 return Some("flag");
40 }
41 if scopes == Scopes::Province && data.item_exists(Item::Province, arg) {
42 return Some("p");
43 }
44 None
45}