|
| 1 | +use std::collections::HashMap; |
| 2 | + |
| 3 | +pub struct ExceptionMap { |
| 4 | + exceptions: HashMap<(String, String), String>, |
| 5 | +} |
| 6 | +impl ExceptionMap { |
| 7 | + pub fn new() -> Self { |
| 8 | + let mut exceptions: HashMap<(String, String), String> = HashMap::new(); |
| 9 | + exceptions.insert( |
| 10 | + ("Relaxaurus".to_string(), "Sparkit".to_string()), |
| 11 | + "Relaxaurus Lux".to_string(), |
| 12 | + ); |
| 13 | + exceptions.insert( |
| 14 | + ("Incineram".to_string(), "Maraith".to_string()), |
| 15 | + "Incineram Noct".to_string(), |
| 16 | + ); |
| 17 | + exceptions.insert( |
| 18 | + ("Mau".to_string(), "Pengullet".to_string()), |
| 19 | + "Mau Cryst".to_string(), |
| 20 | + ); |
| 21 | + exceptions.insert( |
| 22 | + ("Vanwyrm".to_string(), "Foxcicle".to_string()), |
| 23 | + "Vanwyrm Cryst".to_string(), |
| 24 | + ); |
| 25 | + exceptions.insert( |
| 26 | + ("Eikthyrdeer".to_string(), "Hangyu".to_string()), |
| 27 | + "Eikthyrdeer Terra".to_string(), |
| 28 | + ); |
| 29 | + exceptions.insert( |
| 30 | + ("Ephidran".to_string(), "Surfent".to_string()), |
| 31 | + "Elphidran Aqua".to_string(), |
| 32 | + ); |
| 33 | + exceptions.insert( |
| 34 | + ("Pyrin".to_string(), "Katress".to_string()), |
| 35 | + "Pyrin Noct".to_string(), |
| 36 | + ); |
| 37 | + exceptions.insert( |
| 38 | + ("Mammorest".to_string(), "Wumpo".to_string()), |
| 39 | + "Mammorest Cryst".to_string(), |
| 40 | + ); |
| 41 | + exceptions.insert( |
| 42 | + ("Mossanda".to_string(), "Grizzbolt".to_string()), |
| 43 | + "Mossanda Lux".to_string(), |
| 44 | + ); |
| 45 | + exceptions.insert( |
| 46 | + ("Dinossum".to_string(), "Rayhound".to_string()), |
| 47 | + "Dinossom Lux".to_string(), |
| 48 | + ); |
| 49 | + exceptions.insert( |
| 50 | + ("Jolthog".to_string(), "Pengullet".to_string()), |
| 51 | + "Jolthog Cryst".to_string(), |
| 52 | + ); |
| 53 | + exceptions.insert( |
| 54 | + ("Frostallion".to_string(), "Helzephyr".to_string()), |
| 55 | + "Frostallion Noct".to_string(), |
| 56 | + ); |
| 57 | + exceptions.insert( |
| 58 | + ("Kingpaca".to_string(), "Reindrix".to_string()), |
| 59 | + "Ice Kingpaca".to_string(), |
| 60 | + ); |
| 61 | + exceptions.insert( |
| 62 | + ("Lyleen".to_string(), "Menasting".to_string()), |
| 63 | + "Lyleen Noct".to_string(), |
| 64 | + ); |
| 65 | + exceptions.insert( |
| 66 | + ("Leezpunk".to_string(), "Flambelle".to_string()), |
| 67 | + "Leezpunk Ignis".to_string(), |
| 68 | + ); |
| 69 | + exceptions.insert( |
| 70 | + ("Blazehowl".to_string(), "Felbat".to_string()), |
| 71 | + "Blazehowl Noct".to_string(), |
| 72 | + ); |
| 73 | + exceptions.insert( |
| 74 | + ("Robinquill".to_string(), "Fuddler".to_string()), |
| 75 | + "Robinquill Terra".to_string(), |
| 76 | + ); |
| 77 | + exceptions.insert( |
| 78 | + ("Broncherry".to_string(), "Fuack".to_string()), |
| 79 | + "Broncherry Aqua".to_string(), |
| 80 | + ); |
| 81 | + exceptions.insert( |
| 82 | + ("Surfent".to_string(), "Dumud".to_string()), |
| 83 | + "Surfent Terra".to_string(), |
| 84 | + ); |
| 85 | + exceptions.insert( |
| 86 | + ("Gobfin".to_string(), "Rooby".to_string()), |
| 87 | + "Gobfin Ignus".to_string(), |
| 88 | + ); |
| 89 | + exceptions.insert( |
| 90 | + ("Suzaku".to_string(), "Jormuntide".to_string()), |
| 91 | + "Suzaku Aqua".to_string(), |
| 92 | + ); |
| 93 | + exceptions.insert( |
| 94 | + ("Reptyro".to_string(), "Foxcicle".to_string()), |
| 95 | + "Ice Reptyro".to_string(), |
| 96 | + ); |
| 97 | + exceptions.insert( |
| 98 | + ("Hangyu".to_string(), "Swee".to_string()), |
| 99 | + "Hangyu Cryst".to_string(), |
| 100 | + ); |
| 101 | + exceptions.insert( |
| 102 | + ("Mossanda".to_string(), "Petallia".to_string()), |
| 103 | + "Lyleen".to_string(), |
| 104 | + ); |
| 105 | + exceptions.insert( |
| 106 | + ("Vanwyrm".to_string(), "Anubis".to_string()), |
| 107 | + "Faleris".to_string(), |
| 108 | + ); |
| 109 | + exceptions.insert( |
| 110 | + ("Mossanda".to_string(), "Rayhound".to_string()), |
| 111 | + "Grizzbolt".to_string(), |
| 112 | + ); |
| 113 | + exceptions.insert( |
| 114 | + ("Grizzbolt".to_string(), "Relaxaurus".to_string()), |
| 115 | + "Oserk".to_string(), |
| 116 | + ); |
| 117 | + exceptions.insert( |
| 118 | + ("Kitsun".to_string(), "Astegon".to_string()), |
| 119 | + "Shadowbeak".to_string(), |
| 120 | + ); |
| 121 | + exceptions.insert( |
| 122 | + ("Frostallion".to_string(), "Frostallion".to_string()), |
| 123 | + "Frostallion".to_string(), |
| 124 | + ); |
| 125 | + exceptions.insert( |
| 126 | + ("Jetragon".to_string(), "Jetragon".to_string()), |
| 127 | + "Jetragon".to_string(), |
| 128 | + ); |
| 129 | + exceptions.insert( |
| 130 | + ("Paladius".to_string(), "Paladius".to_string()), |
| 131 | + "Paladius".to_string(), |
| 132 | + ); |
| 133 | + exceptions.insert( |
| 134 | + ("Necromus".to_string(), "Necromus".to_string()), |
| 135 | + "Necromus".to_string(), |
| 136 | + ); |
| 137 | + exceptions.insert( |
| 138 | + ( |
| 139 | + "Jormuntide Ignis".to_string(), |
| 140 | + "Jormuntide Ignis".to_string(), |
| 141 | + ), |
| 142 | + "Jormuntide Ignis".to_string(), |
| 143 | + ); |
| 144 | + Self { exceptions } |
| 145 | + } |
| 146 | + |
| 147 | + pub fn parents_exist(&self, parents: (&str, &str)) -> Option<&str> { |
| 148 | + let (father, mother) = parents; |
| 149 | + if let Some(child) = self |
| 150 | + .exceptions |
| 151 | + .get(&(father.to_string(), mother.to_string())) |
| 152 | + { |
| 153 | + Some(child) |
| 154 | + } else { |
| 155 | + None |
| 156 | + } |
| 157 | + } |
| 158 | +} |
0 commit comments