초기커밋
This commit is contained in:
46
ServerBase/Etc/ModuleContext.cs
Normal file
46
ServerBase/Etc/ModuleContext.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using Org.BouncyCastle.Bcpg.OpenPgp;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
using MODULE_ID = System.UInt32;
|
||||
using SORT_ORDER_NO = System.Int32;
|
||||
|
||||
|
||||
namespace ServerBase;
|
||||
|
||||
public class ModuleContext
|
||||
{
|
||||
private readonly MODULE_ID m_module_id;
|
||||
|
||||
private readonly SORT_ORDER_NO m_sort_start_order_no;
|
||||
private readonly SORT_ORDER_NO m_sort_stop_order_no;
|
||||
|
||||
private readonly IConfigParam m_config_param;
|
||||
|
||||
public ModuleContext( MODULE_ID moduleId
|
||||
, SORT_ORDER_NO sortStartOrderNo, SORT_ORDER_NO sortStopOrderNo
|
||||
, IConfigParam configParam )
|
||||
{
|
||||
m_module_id = moduleId;
|
||||
m_sort_start_order_no = sortStartOrderNo;
|
||||
m_sort_stop_order_no = sortStopOrderNo;
|
||||
m_config_param = configParam;
|
||||
}
|
||||
|
||||
public IConfigParam getConfigParam() => m_config_param;
|
||||
|
||||
public SORT_ORDER_NO getSortStartOrderNo() => m_sort_start_order_no;
|
||||
|
||||
public SORT_ORDER_NO getSortStopOrderNo() => m_sort_stop_order_no;
|
||||
|
||||
public MODULE_ID getModuleId() => m_module_id;
|
||||
|
||||
public string toBasicString()
|
||||
{
|
||||
return $"ModuleId:{m_module_id}, ConfigParam:{m_config_param.toBasicString()}";
|
||||
}
|
||||
}
|
||||
38
ServerBase/Etc/ResultValue.cs
Normal file
38
ServerBase/Etc/ResultValue.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
|
||||
using ServerCore; using ServerBase;
|
||||
|
||||
|
||||
namespace ServerBase;
|
||||
|
||||
public class ResultOnly : IWithResult
|
||||
{
|
||||
public Result Result { get; set; }
|
||||
|
||||
public ResultOnly(Result result)
|
||||
{
|
||||
Result = result;
|
||||
}
|
||||
|
||||
public bool isResultOnly() => true;
|
||||
}
|
||||
|
||||
public class ResultValue<TResultValue> : IWithResultValue<TResultValue>
|
||||
{
|
||||
public Result Result { get; set; }
|
||||
public TResultValue ValueOfResult { get; }
|
||||
|
||||
public ResultValue(Result result, TResultValue value)
|
||||
{
|
||||
Result = result;
|
||||
ValueOfResult = value;
|
||||
}
|
||||
|
||||
public bool isResultOnly() => false;
|
||||
}
|
||||
Reference in New Issue
Block a user