Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
add some doc, remove some unused using
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiao921 committed Mar 18, 2021
1 parent 795344c commit 348eabf
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
1 change: 0 additions & 1 deletion ValheimLib/Language.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using MonoMod.RuntimeDetour;
using System;
using System.Collections.Generic;
using ValheimLib.Util;
using ValheimLib.Util.Reflection;

namespace ValheimLib
Expand Down
4 changes: 4 additions & 0 deletions ValheimLib/Mock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

namespace ValheimLib
{
/// <summary>
/// Helper class for creating Mock for a given vanilla Component
/// </summary>
/// <typeparam name="T"></typeparam>
public static class Mock<T> where T : Component
{
public static T Create(string name)
Expand Down
3 changes: 3 additions & 0 deletions ValheimLib/ODB/ObjectDBHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace ValheimLib.ODB
{
/// <summary>
/// Helper class for registering custom items, recipes, and status effects to the game ObjectDB
/// </summary>
public static class ObjectDBHelper
{
internal static readonly List<CustomItem> CustomItems = new List<CustomItem>();
Expand Down
1 change: 0 additions & 1 deletion ValheimLib/ODB/SaveCustomData.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.IO;
using System.Linq;
using UnityEngine.Assertions;

namespace ValheimLib.ODB
{
Expand Down
13 changes: 13 additions & 0 deletions ValheimLib/Util/Events/EventsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

namespace ValheimLib.Util.Events
{
/// <summary>
/// Helper class for C# Events
/// </summary>
public static class EventsHelper
{
/// <summary>
/// Try catch the delegate chain so that it doesnt break on the first failing Delegate
/// </summary>
/// <param name="events"></param>
public static void SafeInvoke(this Action events)
{
if (events == null)
Expand All @@ -24,6 +31,12 @@ public static void SafeInvoke(this Action events)
}
}

/// <summary>
/// Try catch the delegate chain so that it doesnt break on the first failing Delegate
/// </summary>
/// <typeparam name="TArg1"></typeparam>
/// <param name="events"></param>
/// <param name="arg1"></param>
public static void SafeInvoke<TArg1>(this Action<TArg1> events, TArg1 arg1)
{
if (events == null)
Expand Down

0 comments on commit 348eabf

Please sign in to comment.