forked from Exiled-Team/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+Moved the ReflectionExtensions file to EXILED_Main extensions folder and renamed it to Reflection. +Added Config extensions.
- Loading branch information
Showing
5 changed files
with
34 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace EXILED.Extensions | ||
{ | ||
public static class Config | ||
{ | ||
public static Dictionary<string, string> GetStringDictionary(this YamlConfig config, string key, Dictionary<string, string> defaultValue) | ||
{ | ||
var dictionary = config.GetStringDictionary(key); | ||
|
||
if (dictionary?.Count == 0) return defaultValue; | ||
|
||
return dictionary; | ||
} | ||
|
||
public static List<string> GetStringList(this YamlConfig config, string key, List<string> defaultValue) | ||
{ | ||
var list = config.GetStringList(key); | ||
|
||
if (list?.Count == 0) return defaultValue; | ||
|
||
return list; | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
EXILED_Events/ReflectionExtensions.cs → EXILED_Main/Extensions/Reflection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters