Show / Hide Table of Contents

    Interface IModifierFormula

    This is used by the IStage and IGeneratorEntity to apply numeric logic against groups of IModifier objects. Given a target IModifiable this formula returns a value that represents the amount that all referenced IModifierData objects grouped by IModifierGroupData resolve down to. As of 1.0, IModifierFormulas are binded as singletons so there is the assumption only one instance of a type of IModifierFormula and IModifierFormulaData is available. IModifierFormulaData.formula = "base * 4 + ( modifierGroupId1 * modifierGroupId2 )"

    The above formula would replace "base" with baseAmount. It would also collect all IModifierData objects that target the referenced IModifierGroupData ids and resolve those amounts down to a single value per IModifierGroupData. Those values are injected in place of the ids. The result is a completely numeric formula that can then be parsed by the IModifierFormulaParser.

    Inherited Members
    IEntity.Id
    IEntity.Initialize()
    IEntity.Cleanup(IEntityLoaderService)
    Namespace: IdleKit.Gameplay
    Assembly: cs.temp.dll.dll
    Syntax
    public interface IModifierFormula : IEntity, IInjectable

    Properties

    AffectedModifierGroups

    Returns an array of IModifierGroupData that are referenced in the ModifierFormulaData

    Declaration
    IModifierGroupData[] AffectedModifierGroups { get; }
    Property Value
    Type Description
    IModifierGroupData[]

    ModifierFormulaData

    The associated IModifierFormulaData. This contains the actual formula.

    Declaration
    IModifierFormulaData ModifierFormulaData { get; }
    Property Value
    Type Description
    IModifierFormulaData

    Methods

    AffectModifiableType(Type)

    Whether or not the IModifiable's type is included the formula's TargetModifiableTypes

    Declaration
    bool AffectModifiableType(Type modifiableType)
    Parameters
    Type Name Description
    Type modifiableType

    The type of IModifiable that is affected or not

    Returns
    Type Description
    Boolean

    Apply(IModifier[], Double, Int32)

    Given a base amount and any required additional levels, returns a single amount based on the logic of the formula.

    Declaration
    double Apply(IModifier[] modifiers, double baseAmount, int additionalLevels)
    Parameters
    Type Name Description
    IModifier[] modifiers

    The IModifier objects that affect the IModifiable

    Double baseAmount

    The base amount to use in the formula

    Int32 additionalLevels

    Any additional levels to take into account when calculating the formulas result

    Returns
    Type Description
    Double

    IncludeModifier(IModifier)

    Whether or not the IModifier's IModifierDatas include IModifierGroupData that is in the formula's AffectedModifierGroupss

    Declaration
    bool IncludeModifier(IModifier modifier)
    Parameters
    Type Name Description
    IModifier modifier

    The IModifier that is included or not

    Returns
    Type Description
    Boolean
    Back to top Copyright © 2020 East Side Games Inc.