-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
There's limited amount of items and they can be identified with enum, name can be retrieved when needed
This should also reduce code noise.
I suggest to create solution similar to Machine solution:
#[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize)]
pub enum ItemType {
SuperGlue = 0,
Petrol = 1,
// ...
}
impl ItemType {
pub fn t(self, lng: Lang) -> 'static str {
item_names(lng)[self as usize]
}
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers