mirror of
https://github.com/PorktoberRevolution/ReStocked
synced 2024-09-01 17:34:42 +00:00
Make constants all capitals
This commit is contained in:
parent
8d2f5395b8
commit
bbc29c201f
Binary file not shown.
@ -9,7 +9,7 @@ namespace Restock
|
|||||||
[KSPAddon(KSPAddon.Startup.Instantly, true)]
|
[KSPAddon(KSPAddon.Startup.Instantly, true)]
|
||||||
public class ResourceBlacklist : MonoBehaviour
|
public class ResourceBlacklist : MonoBehaviour
|
||||||
{
|
{
|
||||||
private readonly string[] commentSep = { "//" };
|
private readonly string[] COMMENT_SEPARATOR = { "//" };
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
HashSet<UrlDir.UrlFile> blacklist = new HashSet<UrlDir.UrlFile>();
|
HashSet<UrlDir.UrlFile> blacklist = new HashSet<UrlDir.UrlFile>();
|
||||||
@ -24,7 +24,7 @@ namespace Restock
|
|||||||
Debug.Log($"[Restock] Reading blacklist {file.url}.{file.fileExtension}");
|
Debug.Log($"[Restock] Reading blacklist {file.url}.{file.fileExtension}");
|
||||||
foreach (string line in File.ReadAllLines(file.fullPath))
|
foreach (string line in File.ReadAllLines(file.fullPath))
|
||||||
{
|
{
|
||||||
string lineBeforeComment = line.Split(commentSep, 2, StringSplitOptions.None)[0].Trim();
|
string lineBeforeComment = line.Split(COMMENT_SEPARATOR, 2, StringSplitOptions.None)[0].Trim();
|
||||||
if (lineBeforeComment == string.Empty) continue;
|
if (lineBeforeComment == string.Empty) continue;
|
||||||
|
|
||||||
foreach (UrlDir.UrlFile blacklistFile in FindFiles(lineBeforeComment, gameData))
|
foreach (UrlDir.UrlFile blacklistFile in FindFiles(lineBeforeComment, gameData))
|
||||||
@ -38,7 +38,7 @@ namespace Restock
|
|||||||
Debug.Log($"[Restock] Reading whitelist {file.url}.{file.fileExtension}");
|
Debug.Log($"[Restock] Reading whitelist {file.url}.{file.fileExtension}");
|
||||||
foreach (string line in File.ReadAllLines(file.fullPath))
|
foreach (string line in File.ReadAllLines(file.fullPath))
|
||||||
{
|
{
|
||||||
string lineBeforeComment = line.Split(commentSep, 2, StringSplitOptions.None)[0].Trim();
|
string lineBeforeComment = line.Split(COMMENT_SEPARATOR, 2, StringSplitOptions.None)[0].Trim();
|
||||||
if (lineBeforeComment == string.Empty) continue;
|
if (lineBeforeComment == string.Empty) continue;
|
||||||
|
|
||||||
foreach (UrlDir.UrlFile whitelistFile in FindFiles(lineBeforeComment, gameData))
|
foreach (UrlDir.UrlFile whitelistFile in FindFiles(lineBeforeComment, gameData))
|
||||||
@ -62,10 +62,10 @@ namespace Restock
|
|||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly char[] sep = new[] { '/' };
|
private readonly char[] PATH_SEPARATOR = new[] { '/' };
|
||||||
private IEnumerable<UrlDir.UrlFile> FindFiles(string url, UrlDir dir)
|
private IEnumerable<UrlDir.UrlFile> FindFiles(string url, UrlDir dir)
|
||||||
{
|
{
|
||||||
string[] splits = url.Split(sep, 2);
|
string[] splits = url.Split(PATH_SEPARATOR, 2);
|
||||||
|
|
||||||
if (splits.Length == 1)
|
if (splits.Length == 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user