From c966b59e348d7844fea0053bb3b6fc946814ac85 Mon Sep 17 00:00:00 2001 From: automatic9045 <67314487+automatic9045@users.noreply.github.com> Date: Sat, 18 Nov 2023 11:52:34 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[=E3=82=AF=E3=83=A9=E3=82=B9=E3=83=A9?= =?UTF-8?q?=E3=83=83=E3=83=91=E3=83=BC]ObjectPassedEventArgs=E3=81=AE?= =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9=E3=82=AF=E3=82=BF?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClassWrappers/Public/ObjectPassedEventArgs.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Libs/BveTypes/ClassWrappers/Public/ObjectPassedEventArgs.cs b/Libs/BveTypes/ClassWrappers/Public/ObjectPassedEventArgs.cs index ee09c19f..14709d06 100644 --- a/Libs/BveTypes/ClassWrappers/Public/ObjectPassedEventArgs.cs +++ b/Libs/BveTypes/ClassWrappers/Public/ObjectPassedEventArgs.cs @@ -19,6 +19,8 @@ private static void Initialize(BveTypeSet bveTypes) { ClassMemberSet members = bveTypes.GetClassInfoOf(); + Constructor = members.GetSourceConstructor(new Type[] { typeof(int), typeof(MapObjectBase) }); + MapObjectGetMethod = members.GetSourcePropertyGetterOf(nameof(MapObject)); } @@ -30,6 +32,17 @@ protected ObjectPassedEventArgs(object src) : base(src) { } + private static FastConstructor Constructor; + /// + /// クラスの新しいインスタンスを初期化します。 + /// + /// 通過方向。前方向の場合は 1、後方向の場合は -1 を指定してください。 + /// 通過したマップオブジェクト。 + public ObjectPassedEventArgs(int direction, MapObjectBase mapObject) + : this(Constructor.Invoke(new object[] { direction, mapObject.Src })) + { + } + /// /// オリジナル オブジェクトからラッパーのインスタンスを生成します。 ///