Exemplo n.º 1
0
        /// <summary>
        /// Get a float value for a property.
        /// This method is convenient but inefficient.  It should be used
        /// infrequently(i.e. for initializing, loading, saving, etc.),
        /// not in the main loop.If you need to get a value frequently,
        /// it is better to look up the node itself using GetNode and then
        /// use the node's getFloatValue() method, to avoid the lookup overhead.
        /// </summary>
        /// <param name="name">The property name.</param>
        /// <param name="defaultValue">The default value to return if the property does not exist.</param>
        /// <returns>The property's value as a float, or the default value provided.</returns>
        public float GetFloat(string name, float defaultValue = 0.0f)
        {
            PropertyNode node = GetNode(name);

            return(node == null ? defaultValue : node.GetSingle());
        }