예제 #1
0
        /// <summary>
        /// Reset to original optimized remapping.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonOptimize_Click(object sender, EventArgs e)
        {
            // Updates the remapping point with the optimized remapping
            m_remapping.Update();

            // Set all labels and bars to calculated optimized remap
            UpdateControls(m_character, m_plan, m_remapping, m_description);

            // Fires the event
            AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(m_remapping));
        }
예제 #2
0
        /// <summary>
        /// Reset to remapping with current attributes.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonCurrent_Click(object sender, EventArgs e)
        {
            // Make unoptimized remap
            RemappingResult zeroRemapping = new RemappingResult(m_remapping, m_remapping.BaseScratchpad.Clone());

            zeroRemapping.Update();

            // Update the controls
            UpdateControls(m_character, m_plan, zeroRemapping, m_description);

            // Fires the event
            AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(zeroRemapping));
        }
예제 #3
0
        public void AddTrait(Trait item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            if (!traits.Contains(item))
            {
                traits.Add(item);
            }
            item.AttributeChanged += (sender, args) =>
            {
                AttributeChanged?.Invoke(this, args);
            };
            item.ResourceChanged += (sender, args) =>
            {
                ResourceChanged?.Invoke(this, args);
            };
            item.ValueChanged += (sender, args) =>
            {
                ValueChanged?.Invoke(this, args);
            };
            item.TaWChanged += (sender, args) =>
            {
                TaWChanged?.Invoke(this, args);
            };
            item.ATChanged += (sender, args) =>
            {
                ATChanged?.Invoke(this, args);
            };
            item.PAChanged += (sender, args) =>
            {
                PAChanged?.Invoke(this, args);
            };
            item.APInvestChanged += (sender, args) =>
            {
                APInvestChanged?.Invoke(this, GetAPInvested());
            };
            item.APEarnedChanged += (sender, args) =>
            {
                APEarnedChanged?.Invoke(this, GetAPEarned());
            };

            CallChangedAll(item);
        }
예제 #4
0
        /// <summary>
        /// Calculates new remapping from values of controls.
        /// </summary>
        private void Recalculate()
        {
            CharacterScratchpad scratchpad = m_remapping.BaseScratchpad.Clone();

            scratchpad.Memory.Base       = pbMEMRemappable.Value + EveConstants.CharacterBaseAttributePoints;
            scratchpad.Charisma.Base     = pbCHARemappable.Value + EveConstants.CharacterBaseAttributePoints;
            scratchpad.Willpower.Base    = pbWILRemappable.Value + EveConstants.CharacterBaseAttributePoints;
            scratchpad.Perception.Base   = pbPERRemappable.Value + EveConstants.CharacterBaseAttributePoints;
            scratchpad.Intelligence.Base = pbINTRemappable.Value + EveConstants.CharacterBaseAttributePoints;

            // Get remapping for provided attributes
            RemappingResult manualRemapping = new RemappingResult(m_remapping,
                                                                  scratchpad);

            manualRemapping.Update();
            UpdateControls(m_character, m_plan, manualRemapping, m_description);

            // Notify the changes
            AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(manualRemapping));
        }
예제 #5
0
        /// <summary>
        /// Updates the controls with the values from the current remapping point.
        /// </summary>
        /// <param name="point"></param>
        /// <exception cref="System.ArgumentNullException">point</exception>
        public void UpdateValuesFrom(RemappingPoint point)
        {
            point.ThrowIfNull(nameof(point));

            // Creates a scratchpad with the base values from the provided point.
            CharacterScratchpad scratchpad = new CharacterScratchpad(m_character.After(m_plan.ChosenImplantSet));

            for (int i = 0; i < 5; i++)
            {
                scratchpad[(EveAttribute)i].Base = point[(EveAttribute)i];
            }

            RemappingResult remapping = new RemappingResult(m_remapping, scratchpad);

            remapping.Update();

            // Update the controls
            UpdateControls(m_character, m_plan, remapping, m_description);

            // Fires the event
            AttributeChanged?.ThreadSafeInvoke(this, new AttributeChangedEventArgs(remapping));
        }
예제 #6
0
        public ChangeObjectNormalAttributeAction(GameObject obj,
                                                 AttributeChanged attrib, Vector3 newValue)
        {
            this.obj    = obj;
            this.attrib = attrib;

            switch (attrib)
            {
            case AttributeChanged.Position:
                oldValue = obj.transform.position;
                break;

            case AttributeChanged.Rotation:
                oldValue = obj.transform.rotation.eulerAngles;
                break;

            case AttributeChanged.Scale:
                oldValue = obj.transform.localScale;
                break;
            }

            this.newValue = newValue;
        }
예제 #7
0
 public void OnAttributeChanged(INode sender, string att, int index) => AttributeChanged?.Invoke(sender, att, index);
예제 #8
0
 protected virtual void OnAttributeChanged(AttributeChangedEventArgs e)
 {
     AttributeChanged?.Invoke(this, e);
 }
예제 #9
0
 protected void onAttributeChanged()
 {
     AttributeChanged?.Invoke(this, new System.EventArgs());
 }
예제 #10
0
파일: SvgElement.cs 프로젝트: carbon/SVG
 protected void OnAttributeChanged(AttributeEventArgs args)
 {
     AttributeChanged?.Invoke(this, args);
 }