Esempio n. 1
0
        public void UpdateView( 
            AllPropositions props )
        {
            ignoreChanges = true;
            allProps = props;

            propTypeBonuses = props.PropositionTypeBonuses;
            propTypeBonusesDefault = props.Default.PropositionTypeBonuses;

            bfnBonuses = props.BraveFaithBonuses;
            bfnBonusesDefault = props.Default.BraveFaithBonuses;

            UpdateRowHeaders( FFTPatch.Context );

            foreach (PropositionClass clas in (PropositionClass[])Enum.GetValues( typeof( PropositionClass ) ))
            {
                foreach (PropositionType type in (PropositionType[])Enum.GetValues( typeof( PropositionType ) ))
                {
                    if (propTypeBonuses.ContainsKey( Tuple.From( type, clas ) ))
                    {
                        dataGridView1[(int)type, (int)clas].Value = propTypeBonuses[type, clas];
                    }
                }

                foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues( typeof( BraveFaithNeutral ) ))
                {
                    if (bfnBonuses.ContainsKey( Tuple.From( bfn, clas ) ))
                    {
                        dataGridView1[(int)bfn - 1 + braveColumn.Index, (int)clas].Value = bfnBonuses[bfn, clas];
                    }
                }
            }
            ignoreChanges = false;
        }
Esempio n. 2
0
        public void UpdateView(
            AllPropositions props)
        {
            ignoreChanges = true;
            allProps      = props;

            propTypeBonuses        = props.PropositionTypeBonuses;
            propTypeBonusesDefault = props.Default.PropositionTypeBonuses;

            bfnBonuses        = props.BraveFaithBonuses;
            bfnBonusesDefault = props.Default.BraveFaithBonuses;

            UpdateRowHeaders(FFTPatch.Context);

            foreach (PropositionClass clas in (PropositionClass[])Enum.GetValues(typeof(PropositionClass)))
            {
                foreach (PropositionType type in (PropositionType[])Enum.GetValues(typeof(PropositionType)))
                {
                    if (propTypeBonuses.ContainsKey(Tuple.From(type, clas)))
                    {
                        dataGridView1[(int)type, (int)clas].Value = propTypeBonuses[type, clas];
                    }
                }

                foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues(typeof(BraveFaithNeutral)))
                {
                    if (bfnBonuses.ContainsKey(Tuple.From(bfn, clas)))
                    {
                        dataGridView1[(int)bfn - 1 + braveColumn.Index, (int)clas].Value = bfnBonuses[bfn, clas];
                    }
                }
            }
            ignoreChanges = false;
        }
        public void UpdateView(
            AllPropositions props)
        {
            ignoreChanges       = true;
            this.props          = props;
            levelBonuses        = props.LevelBonuses;
            levelBonusesDefault = props.Default.LevelBonuses;

            braveBonuses        = props.BraveStatBonuses;
            braveBonusesDefault = props.Default.BraveStatBonuses;

            faithBonuses        = props.FaithStatBonuses;
            faithBonusesDefault = props.Default.FaithStatBonuses;

            UpdateRowHeaders(FFTPatch.Context);

            foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues(typeof(BraveFaithNeutral)))
            {
                foreach (BraveFaithRange bfr in (BraveFaithRange[])Enum.GetValues(typeof(BraveFaithRange)))
                {
                    var thisTuple = Tuple.From(bfn, bfr);
                    if (braveBonuses.ContainsKey(thisTuple))
                    {
                        dataGridView1[(int)bfn, (int)bfr + braveBonusesFirstRow].Value = braveBonuses[bfn, bfr];
                    }

                    if (faithBonuses.ContainsKey(thisTuple))
                    {
                        dataGridView1[(int)bfn, (int)bfr + faithBonusesFirstRow].Value = faithBonuses[bfn, bfr];
                    }
                }

                foreach (LevelRange lr in (LevelRange[])Enum.GetValues(typeof(LevelRange)))
                {
                    if (levelBonuses.ContainsKey(Tuple.From(bfn, lr)))
                    {
                        dataGridView1[(int)bfn, (int)lr + levelBonusesFirstRow].Value = levelBonuses[bfn, lr];
                    }
                }
            }

            ignoreChanges = false;
        }
Esempio n. 4
0
        private void CopyFromRow(int destRowIndex, DataGridViewRow source)
        {
            PropositionClass destRowClass = (PropositionClass)destRowIndex;
            int sourceRowIndex            = source.Index;

            foreach (PropositionType type in (PropositionType[])Enum.GetValues(typeof(PropositionType)))
            {
                if (propTypeBonuses.ContainsKey(Tuple.From(type, destRowClass)))
                {
                    propTypeBonuses[type, destRowClass] = (byte)(dataGridView1[(int)type, (int)sourceRowIndex].Value);
                }
            }

            foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues(typeof(BraveFaithNeutral)))
            {
                if (bfnBonuses.ContainsKey(Tuple.From(bfn, destRowClass)))
                {
                    bfnBonuses[bfn, destRowClass] = (byte)(dataGridView1[(int)bfn - 1 + braveColumn.Index, (int)sourceRowIndex].Value);
                }
            }
        }
Esempio n. 5
0
        public void UpdateView(
            AllPropositions props )
        {
            ignoreChanges = true;
            this.props = props;
            levelBonuses = props.LevelBonuses;
            levelBonusesDefault = props.Default.LevelBonuses;

            braveBonuses = props.BraveStatBonuses;
            braveBonusesDefault = props.Default.BraveStatBonuses;

            faithBonuses = props.FaithStatBonuses;
            faithBonusesDefault = props.Default.FaithStatBonuses;

            UpdateRowHeaders( FFTPatch.Context );

            foreach (BraveFaithNeutral bfn in (BraveFaithNeutral[])Enum.GetValues( typeof( BraveFaithNeutral ) ))
            {
                foreach (BraveFaithRange bfr in (BraveFaithRange[])Enum.GetValues( typeof( BraveFaithRange ) ))
                {
                    var thisTuple = Tuple.From( bfn, bfr );
                    if (braveBonuses.ContainsKey( thisTuple ))
                    {
                        dataGridView1[(int)bfn, (int)bfr + braveBonusesFirstRow].Value = braveBonuses[bfn, bfr];
                    }

                    if (faithBonuses.ContainsKey( thisTuple ))
                    {
                        dataGridView1[(int)bfn, (int)bfr + faithBonusesFirstRow].Value = faithBonuses[bfn, bfr];
                    }
                }

                foreach (LevelRange lr in (LevelRange[])Enum.GetValues( typeof( LevelRange ) ))
                {
                    if (levelBonuses.ContainsKey( Tuple.From( bfn, lr ) ))
                    {
                        dataGridView1[(int)bfn, (int)lr + levelBonusesFirstRow].Value = levelBonuses[bfn, lr];
                    }
                }
            }

            ignoreChanges = false;
        }