Exemple #1
0
        public void AddAttribute(string name, AttributeTypes type, string value)
        {
            Attribute attribute = null;

            switch (type)
            {
            case AttributeTypes.String: attribute = new StringAttribute(name); break;

            case AttributeTypes.Int: attribute = new IntAttribute(name); break;

            case AttributeTypes.Float: attribute = new FloatAttribute(name); break;

            case AttributeTypes.Vector2: attribute = new Vector2Attribute(name); break;

            case AttributeTypes.Vector3: attribute = new Vector3Attribute(name); break;

            case AttributeTypes.Quaternion: attribute = new QuaternionAttribute(name); break;

            case AttributeTypes.Matrix: attribute = new MatrixAttribute(name); break;

            case AttributeTypes.Bool: attribute = new BoolAttribute(name); break;

            default: throw new System.Exception("AttributeType '" + type + "' does not exist!");
            }
            attribute.Initialize(value);
            AddAttribute(attribute);
        }
Exemple #2
0
        public Matrix GetMatrix <T>(T attributeName)
        {
            if (!CheckRead(36))
            {
                return(null);
            }

            MatrixAttribute <T> matrixAttribute = new MatrixAttribute <T>(attributeName);

            Parse(matrixAttribute);

            return(matrixAttribute.Matrix);
        }