예제 #1
0
 public void AddProperty(string name, EAttributeType type, object value)
 {
     namevalmap.Add(name, Tuple.Create(type, value));
     Properties.Add(new ExtendedProperty {
         Type = type, Name = name, Value = value
     });
 }
예제 #2
0
        private Attribute BuildAttributeOfTypeImpl(EAttributeType atttype, PropertyInfo prop, string name)
        {
            Attribute att;

            if (atttype == EAttributeType.Nominal)
            {
                att = GetNominalAttribute(prop);
            }
            else if (atttype == EAttributeType.Numeric)
            {
                att = new Attribute(name);
            }
            else if (atttype == EAttributeType.Binary)
            {
                att = new Attribute(name, binary);
            }
            else if (atttype == EAttributeType.String)
            {
                att = new Attribute(name, (ArrayList)null);
            }
            else if (atttype == EAttributeType.Date)
            {
                att = new Attribute(name, ISO_8601_DATE_FORMAT); // ISO-8601 Format
            }
            else
            {
                throw new NotSupportedException(atttype + " is not a supported attribute atttype.");
            }
            return(att);
        }
예제 #3
0
 public void RemoveDataChangedEvent(EAttributeType attributeType, UnityAction <float, float> dataChanged)
 {
     if (attributeMaps.TryGetValue(attributeType, out FAttributeData data))
     {
         data.OnDataChangedDeletage -= dataChanged;
     }
 }
예제 #4
0
 public void AddAttribute(EAttributeType attributeType, float baseValue, bool isNormalData = false)
 {
     if (!attributeMaps.ContainsKey(attributeType))
     {
         attributeMaps.Add(attributeType, new FAttributeData(baseValue, isNormalData));
     }
 }
예제 #5
0
 public void RegisterDataChangedEvent(EAttributeType attributeType, UnityAction <float, float> dataChanged)
 {
     if (attributeMaps.TryGetValue(attributeType, out FAttributeData data))
     {
         dataChanged?.Invoke(data.BaseValue, data.CurrentValue);
         data.OnDataChangedDeletage += dataChanged;
     }
 }
 public AbilityBuffModifiers(AbilitySystemComponent abilitySystem, Editor_FModifierData inData)
 {
     this.abilitySystem     = abilitySystem;
     attributeType          = inData.attributeType;
     modifierOption         = inData.modifierOption;
     modifierType           = inData.modifierType;
     attributeMagnitudeList = inData.attributeMagnitudeList;
 }
예제 #7
0
 public bool GetAttributeData(EAttributeType attributeType, out FAttributeData attributeData)
 {
     if (attributeMaps.TryGetValue(attributeType, out FAttributeData data))
     {
         attributeData = data;
         return(true);
     }
     attributeData = null;
     //attributeData = new FAttributeData();
     return(false);
 }
예제 #8
0
        public AttributeValue(EAttributeType Type, object Value, string Data) : this(Type, Data.ToString(CultureInfo.InvariantCulture))
        {
            if (Data is null)
            {
                throw new ArgumentNullException(nameof(Data));
            }
            if (Value is null)
            {
                throw new ArgumentNullException(nameof(Value));
            }
            Contract.EndContractBlock();

            this.Value = Value;
        }
예제 #9
0
        /// <summary>
        /// Creates a DOM attribute definition
        /// </summary>
        /// <param name="Name">DOM attribute name</param>
        /// <param name="Flags">Indicates what aspects of an element this property affects</param>
        /// <param name="MissingValueDefault">Default value for the attribute</param>
        /// <param name="Keywords">List of keywords which can be assigned to this attribute</param>
        public AttributeDefinition(AtomicName <EAttributeName> Name, EAttributeType Type = 0x0, AttributeValue MissingValueDefault = null, AttributeValue InvalidValueDefault = null, EAttributeFlags Flags = 0x0, string[] Keywords = null, Type enumType = null, dynamic lowerRange = null, dynamic upperRange = null, string[] SupportedTokens = null)
            : this(Keywords, SupportedTokens)
        {
            this.ElementType         = typeof(Element);
            this.Name                = Name;
            this.Flags               = Flags;
            this.MissingValueDefault = MissingValueDefault;
            this.InvalidValueDefault = InvalidValueDefault;
            this.enumType            = enumType;
            this.LowerRange          = lowerRange;
            this.UpperRange          = upperRange;

            // Append the specified allowed types to our defaults
            this.Type |= Type;
        }
예제 #10
0
        public static void Parse_Length(DataConsumer <char> Stream, out float outValue, out EAttributeType outType)
        {
            if (Stream is null)
            {
                throw new ArgumentNullException(nameof(Stream));
            }
            Contract.EndContractBlock();

            if (Try_Parse_Length(Stream, out double outParsedValue, out EAttributeType outParsedType))
            {
                outValue = (float)outParsedValue;
                outType  = outParsedType;
                return;
            }
예제 #11
0
        /* 32-bit */
        public static void Parse_Length(ReadOnlyMemory <char> input, out float outValue, out EAttributeType outType)
        {
            DataConsumer <char> Stream = new DataConsumer <char>(input, EOF);

            Parse_Length(Stream, out double outParsedValue, out EAttributeType outParsedType);
            outValue = (float)outParsedValue;
            outType  = outParsedType;
        }
예제 #12
0
 public FAttributeData GetAttributeData(EAttributeType attributeType)
 {
     attributeMaps.TryGetValue(attributeType, out FAttributeData data);
     return(data);
 }
예제 #13
0
 private AttributeValue(EAttributeType Type, string Data)
 {
     type = Type;
     data = Data;
 }
예제 #14
0
 /// <summary>
 /// Defines the type of the attribute to generate.
 /// </summary>
 public Add AttributeType(EAttributeType value)
 {
     Impl.setAttributeType(new weka.core.SelectedTag((int)value, weka.filters.unsupervised.attribute.Add.TAGS_TYPE));
     return(this);
 }
예제 #15
0
 /// <summary>
 /// The type of attribute to remove.
 /// </summary>
 public RemoveType AttributeType(EAttributeType type)
 {
     Impl.setAttributeType(new weka.core.SelectedTag((int)type, weka.filters.unsupervised.attribute.RemoveType.TAGS_ATTRIBUTETYPE));
     return(this);
 }