public static void initClasses() { masterKlassList = new Dictionary<string, Klass>(); Dictionary<String, Object> dict = (Dictionary<String, Object>)Utility.parse_JSON( @"content\dat\Class.json" ); foreach( string key in dict.Keys ) { Klass k = new Klass( key, dict[key] as Dictionary<string, object> ); masterKlassList.Add( key.ToLower(), k ); } }
public Inventory GetWearableEquipmentSet( Klass klass, EquipSlotType slot ) { Inventory ret = new Inventory(); foreach( ItemSlot sl in this.equipment ) { if( sl.item.equip_slot == slot && sl.item.equip_classes.Contains( klass ) ) { ret.AddItem( sl.item, sl.quant ); } } if( slot != EquipSlotType.RightHand && slot != EquipSlotType.Body ) { // can't unequip from RH or Body slots ret.AddItem( Item.none, 1 ); } return ret; }