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();
        }
示例#3
0
        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();
        }
示例#4
0
 internal EquipmentItemViewModel(EquipmentItemsViewModel vm, uint index, IResourceGetter resourceGetter)
 {
     _vm             = vm;
     _index          = index;
     _resourceGetter = resourceGetter;
 }
 internal EquipmentItemViewModel(EquipmentItemsViewModel vm, uint index)
 {
     _vm      = vm;
     _index   = index;
     ValueSet = new KhEnumListModel <EnumIconTypeModel <EquipmentType>, EquipmentType>(() => Equipment, value => Equipment = value);
 }