1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-30 05:15:59 +02:00

Added 'interface' and 'enum' constraints

This commit is contained in:
Brian Fiete 2020-11-10 05:44:23 -08:00
parent f63b9236d0
commit f41365a58e
8 changed files with 110 additions and 27 deletions

View file

@ -423,7 +423,7 @@ namespace Beefy.utils
}
}
public void Get<T>(StringView name, ref T val) where T : Enum
public void Get<T>(StringView name, ref T val) where T : enum
{
Object obj = Get(name);
if (obj == null)
@ -547,7 +547,7 @@ namespace Beefy.utils
return (bool)aVal;
}
public T GetEnum<T>(String name, T defaultVal = default(T)) where T : Enum
public T GetEnum<T>(String name, T defaultVal = default(T)) where T : enum
{
Object obj = Get(name);
if (obj == null)
@ -566,7 +566,7 @@ namespace Beefy.utils
return defaultVal;
}
public bool GetEnum<T>(String name, ref T val) where T : Enum
public bool GetEnum<T>(String name, ref T val) where T : enum
{
Object obj = Get(name);
if (obj == null)
@ -614,7 +614,7 @@ namespace Beefy.utils
return;
}
public T GetCurEnum<T>(T theDefault = default) where T : Enum
public T GetCurEnum<T>(T theDefault = default) where T : enum
{
Object obj = GetCurrent();