新增 FlowScope Git 包雏形
This commit is contained in:
22
Packages/com.flowscope.gamecore/Runtime/Common/ResultLog.cs
Normal file
22
Packages/com.flowscope.gamecore/Runtime/Common/ResultLog.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowScope.Common
|
||||
{
|
||||
public sealed class ResultLog
|
||||
{
|
||||
private readonly List<string> _warnings = new();
|
||||
private readonly List<string> _errors = new();
|
||||
|
||||
public IReadOnlyList<string> Warnings => _warnings;
|
||||
public IReadOnlyList<string> Errors => _errors;
|
||||
public bool HasErrors => _errors.Count > 0;
|
||||
|
||||
public void AddWarning(string message) => _warnings.Add(message);
|
||||
public void AddError(string message) => _errors.Add(message);
|
||||
public void Clear()
|
||||
{
|
||||
_warnings.Clear();
|
||||
_errors.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user