51 lines
1.6 KiB
Dart
51 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../game/enums.dart';
|
|
import '../game/config.dart';
|
|
|
|
class ItemUtils {
|
|
static Color getRarityColor(ItemRarity rarity) {
|
|
switch (rarity) {
|
|
case ItemRarity.normal:
|
|
return ThemeConfig.rarityNormal;
|
|
case ItemRarity.magic:
|
|
return ThemeConfig.rarityMagic;
|
|
case ItemRarity.rare:
|
|
return ThemeConfig.rarityRare;
|
|
case ItemRarity.legendary:
|
|
return ThemeConfig.rarityLegendary;
|
|
case ItemRarity.unique:
|
|
return ThemeConfig.rarityUnique;
|
|
}
|
|
}
|
|
|
|
static String getIconPath(EquipmentSlot slot) {
|
|
switch (slot) {
|
|
case EquipmentSlot.weapon:
|
|
return 'assets/images/icons/weapons/sword_02.png';
|
|
case EquipmentSlot.shield:
|
|
return 'assets/images/icons/subweapons/shield_01.png';
|
|
case EquipmentSlot.armor:
|
|
return 'assets/images/icons/armors/armor_02.png';
|
|
case EquipmentSlot.accessory:
|
|
return 'assets/images/icons/accessories/ring_02.png';
|
|
case EquipmentSlot.consumable:
|
|
return 'assets/images/icons/potions/potion_blue.png';
|
|
}
|
|
}
|
|
|
|
static String getBorderPath(ItemRarity rarity) {
|
|
switch (rarity) {
|
|
case ItemRarity.normal:
|
|
return 'assets/images/icons/borders/border_000.png';
|
|
case ItemRarity.magic:
|
|
return 'assets/images/icons/borders/border_001.png';
|
|
case ItemRarity.rare:
|
|
return 'assets/images/icons/borders/border_004.png';
|
|
case ItemRarity.legendary:
|
|
return 'assets/images/icons/borders/border_005.png';
|
|
case ItemRarity.unique:
|
|
return 'assets/images/icons/borders/border_014.png';
|
|
}
|
|
}
|
|
}
|