Skip to content

Commit

Permalink
feat: support EFT fits with service modules (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain authored Aug 6, 2024
1 parent e305c01 commit c5fe1ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/calculate/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub enum SlotType {
Low,
Rig,
SubSystem,
Service,
DroneBay,
Charge,
None,
Expand Down
1 change: 1 addition & 0 deletions src/calculate/pass_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ impl Pass for PassOne {
EsfSlotType::Low => SlotType::Low,
EsfSlotType::Rig => SlotType::Rig,
EsfSlotType::SubSystem => SlotType::SubSystem,
EsfSlotType::Service => SlotType::Service,
},
index: Some(module.slot.index),
},
Expand Down
1 change: 1 addition & 0 deletions src/data_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ pub enum EsfSlotType {
Low,
Rig,
SubSystem,
Service,
}

#[derive(Deserialize, Debug)]
Expand Down
7 changes: 7 additions & 0 deletions src/eft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ fn find_slot_type_index(
*index += 1;
return Some((data_types::EsfSlotType::SubSystem, *index - 1));
}
6306 => {
let index = module_slots
.entry(data_types::EsfSlotType::Service)
.or_insert(0);
*index += 1;
return Some((data_types::EsfSlotType::Service, *index - 1));
}
_ => {}
}
}
Expand Down

0 comments on commit c5fe1ed

Please sign in to comment.