diff --git a/Campofinale/Resource/ResourceLoader.cs b/Campofinale/Resource/ResourceLoader.cs
index f2fa7a8..e0607a3 100644
--- a/Campofinale/Resource/ResourceLoader.cs
+++ b/Campofinale/Resource/ResourceLoader.cs
@@ -11,7 +11,9 @@ namespace Campofinale.Resource
{
public class ResourceLoader
{
-
+ ///
+ /// Load table cfg automatically inside ResourceManager fields
+ ///
public static void LoadTableCfg()
{
var tableCfgTypes = GetAllTableCfgTypes();
@@ -19,7 +21,7 @@ namespace Campofinale.Resource
foreach (var type in tableCfgTypes)
{
var attr = type.GetCustomAttribute();
- string json = ReadJsonFile(attr.Name);
+ string json = ResourceManager.ReadJsonFile(attr.Name);
FieldInfo field = GetResourceField(type);
if (field != null && json.Length > 0)
{
@@ -49,21 +51,7 @@ namespace Campofinale.Resource
return JsonConvert.DeserializeObject(json, valueType);
}
- public static string ReadJsonFile(string path)
- {
- try
- {
- return File.ReadAllText(path);
- }
- catch (Exception e)
- {
- Logger.PrintError($"Error occured while loading {path} Err: {e.Message}");
- ResourceManager.missingResources = true;
- return "";
- }
-
- }
-
+
public static List GetAllTableCfgTypes()
{
return Assembly.GetExecutingAssembly()
diff --git a/Campofinale/Resource/ResourceManager.cs b/Campofinale/Resource/ResourceManager.cs
index f40fc32..b1f1d2e 100644
--- a/Campofinale/Resource/ResourceManager.cs
+++ b/Campofinale/Resource/ResourceManager.cs
@@ -78,6 +78,11 @@ namespace Campofinale.Resource
return levelDatas.Find(a => a.id == name).idNum;
}
public static bool missingResources = false;
+ ///
+ /// Utility method for read a json file
+ ///
+ /// The file path
+ /// Return the file content if the file exist, else it return an empty string
public static string ReadJsonFile(string path)
{
try
diff --git a/Campofinale/Resource/TableCfgResource.cs b/Campofinale/Resource/TableCfgResource.cs
index 9f75734..15d7c48 100644
--- a/Campofinale/Resource/TableCfgResource.cs
+++ b/Campofinale/Resource/TableCfgResource.cs
@@ -8,7 +8,9 @@ namespace Campofinale.Resource
{
public abstract class TableCfgResource
{
-
+ ///
+ /// Not implemented yet
+ ///
public void OnLoad()
{
@@ -17,7 +19,13 @@ namespace Campofinale.Resource
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public class TableCfgTypeAttribute : Attribute
{
+ ///
+ /// Path of the Resource
+ ///
public string Name { get; }
+ ///
+ /// Priority of load (still not implemented)
+ ///
public LoadPriority Priority { get; }
public TableCfgTypeAttribute(string name, LoadPriority priority)