Skip to content

Commit

Permalink
feat: [クラスラッパー]ObjectPassedEventArgsのコンストラクタを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic9045 committed Nov 18, 2023
1 parent beb9258 commit c966b59
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Libs/BveTypes/ClassWrappers/Public/ObjectPassedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ private static void Initialize(BveTypeSet bveTypes)
{
ClassMemberSet members = bveTypes.GetClassInfoOf<ObjectPassedEventArgs>();

Constructor = members.GetSourceConstructor(new Type[] { typeof(int), typeof(MapObjectBase) });

MapObjectGetMethod = members.GetSourcePropertyGetterOf(nameof(MapObject));
}

Expand All @@ -30,6 +32,17 @@ protected ObjectPassedEventArgs(object src) : base(src)
{
}

private static FastConstructor Constructor;
/// <summary>
/// <see cref="ObjectPassedEventArgs"/> クラスの新しいインスタンスを初期化します。
/// </summary>
/// <param name="direction">通過方向。前方向の場合は 1、後方向の場合は -1 を指定してください。</param>
/// <param name="mapObject">通過したマップオブジェクト。</param>
public ObjectPassedEventArgs(int direction, MapObjectBase mapObject)
: this(Constructor.Invoke(new object[] { direction, mapObject.Src }))
{
}

/// <summary>
/// オリジナル オブジェクトからラッパーのインスタンスを生成します。
/// </summary>
Expand Down

0 comments on commit c966b59

Please sign in to comment.