예제 #1
0
        /// <summary>
        /// Compares the value of this variant with another
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Compare(StratusVariant other)
        {
            if (this.type != other.type)
            {
                throw new Exception("Mismatching variants are being compared!");
            }

            switch (other.type)
            {
            case VariantType.Boolean:
                return(this.booleanValue == other.booleanValue);

            case VariantType.Integer:
                return(this.integerValue == other.integerValue);

            case VariantType.Float:
                return(this.floatValue == other.floatValue);

            case VariantType.String:
                return(this.stringValue == other.stringValue);

            case VariantType.Vector3:
                return(this.vector3Value == other.vector3Value);
            }

            throw new Exception("Wrong type?");
        }
예제 #2
0
 //--------------------------------------------------------------------/
 // Methods
 //--------------------------------------------------------------------/
 /// <summary>
 /// Constructs a symbol with the given key and value
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 public static StratusSymbol Construct <T>(string key, T value)
 {
     return(new StratusSymbol(key, StratusVariant.Make(value)));
 }
예제 #3
0
 public StratusSymbol(string key, StratusVariant value) : base(key, value)
 {
 }
예제 #4
0
 public StratusKeyVariantPair(StratusKeyVariantPair <KeyType> other)
 {
     key = other.key; value = new StratusVariant(other.value);
 }
예제 #5
0
 public StratusKeyVariantPair(KeyType key, StratusVariant value)
 {
     this.key = key; this.value = new StratusVariant(value);
 }
예제 #6
0
 public StratusVariant(StratusVariant variant) : this()
 {
     type = variant.type;
     this.Set(variant.Get());
 }