Wycademy/src/Wycademy/Commands/Entities/EvalEnvironment.cs
/// <summary>
/// Retrieves an object from the environment by its name and attempts to cast it to a type.
/// </summary>
/// <typeparam name="T">The type that the object should be cast to.</typeparam>
/// <param name="name">The name of the object to retrieve.</param>
/// <returns>The object as <typeparamref name="T"/>, or <see cref="default(T)"/> if the cast was unsuccessful.</returns>
/// <exception cref="KeyNotFoundException"><paramref name="name"/> is not the name of any object in the environment.</exception>
Retrieves an object from the environment by its name and attempts to cast it to a type.
Retrieves an object from the environment by its name and attempts to cast it to a type .
public T GetTyped<T>(string name)
        {
            object obj = _storage[name];
            try
            {
                return (T)obj;
            }
            catch (InvalidCastException)
            {
                return default(T);
            }
        }
public T GetTyped < T > ( string name ) { object obj = _storage [ name ] ; try { return ( T ) obj ; } catch ( InvalidCastException ) { return default ( T ) ; } }
Retrieves an object from the environment by its name and attempts to cast it to a type.
Retrieves an object from the environment by its name and attempts to cast it to a type .
The object as , or  if the cast was unsuccessful.
The object as or if the cast was unsuccessful .
None
name
string
The name of the object to retrieve.
The name of the object to retrieve .
typeparam
The type that the object should be cast to.
The type that the object should be cast to .