public PlayerViewModel(Character character, int index) { this.character = character; this.index = index; Weapon = new ItemComboBoxModel <EquipmentType>(() => character.Weapon, x => character.Weapon = x); Armors = new EquipmentItemsViewModel(EquipmentManagerFactory.ForArmor(character)); Accessories = new EquipmentItemsViewModel(EquipmentManagerFactory.ForAccessory(character)); Consumables = new EquipmentItemsViewModel(EquipmentManagerFactory.ForConsumable(character)); }
public CharacterViewModel(Character character, int index) { this.character = character; this.index = index; Weapon = new ItemComboBoxModel <EquipmentType>(() => character.Weapon, x => character.Weapon = x); Armors = new EquipmentItemsViewModel(EquipmentManagerFactory.ForArmor(character)); Accessories = new EquipmentItemsViewModel(EquipmentManagerFactory.ForAccessory(character)); Consumables = new EquipmentItemsViewModel(EquipmentManagerFactory.ForConsumable(character)); Abilities = character.Abilities.Select((_, i) => new AbilityModel(i, character.Abilities)).ToList(); }
public CharacterViewModel(ICharacter character, int index, IResourceGetter resourceGetter) { this.character = character; this.index = index; _resourceGetter = resourceGetter; Armors = new EquipmentItemsViewModel(EquipmentManagerFactory.ForArmor(character), resourceGetter); Accessories = new EquipmentItemsViewModel(EquipmentManagerFactory.ForAccessory(character), resourceGetter); Consumables = new EquipmentItemsViewModel(EquipmentManagerFactory.ForConsumable(character), resourceGetter); Abilities = character.Abilities.Select((_, i) => new AbilityModel(i, character.Abilities, resourceGetter)).ToList(); }