Пример #1
0
        private void EditToView()
        {
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var hasChanges = false;

            if (!cmdSizeModifier.Equals(sheet.cmdSizeModifier))
            {
                hasChanges            = true;
                sheet.cmdSizeModifier = cmdSizeModifier;
            }
            if (!cmbSizeModifier.Equals(sheet.cmbSizeModifier))
            {
                hasChanges            = true;
                sheet.cmbSizeModifier = cmbSizeModifier;
            }
#if SELECT_CURRENT_ATTACK
            if (currentAttack != sheet.currentAttack)
            {
                hasChanges          = true;
                sheet.currentAttack = currentAttack;
            }
#endif
            if (hasChanges)
            {
                CharacterSheetStorage.Instance.SaveCharacter();
            }
        }
        private void EditToView()
        {
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            MainPage.StrToInt(Value.Text, ref attackBonus.baseValue);
            if (!sizeModifiers.Equals(sheet.attackSizeModifier) || !attackBonus.Equals(sheet.attackBonusModifiers) || (currentAttack != sheet.currentAttack))
            {
                sheet.currentAttack        = currentAttack;
                sheet.attackBonusModifiers = attackBonus;
                sheet.attackSizeModifier   = sizeModifiers;
                CharacterSheetStorage.Instance.SaveCharacter();
            }
        }
        private void EditToView()
        {
            var sheet = CharacterSheetStorage.Instance.selectedCharacter;

            if (sheet == null)
            {
                return;
            }
            var bab = baseAttackBonus.GetRange(0, attacksCount);

            if ((currentAttack != sheet.currentAttack) ||
                !CharacterSheet.IsEqual(bab, sheet.baseAttackBonus) ||
                !currentAttacksCount.Equals(sheet.currentAttacksCount))
            {
                sheet.baseAttackBonus = bab;
                sheet.currentAttack   = currentAttack;
                sheet.currentAttacksCount.Fill(currentAttacksCount);
                CharacterSheetStorage.Instance.SaveCharacter();
            }
        }