From 9edc4239b7e128209bfe9486f7a1ec92e0710c9d Mon Sep 17 00:00:00 2001 From: automatic9045 <67314487+automatic9045@users.noreply.github.com> Date: Sun, 27 Aug 2023 12:47:56 +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]MapObjectList=E3=81=A7=E8=B7=9D?= =?UTF-8?q?=E9=9B=A2=E7=A8=8B=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=99=E3=82=8B?= =?UTF-8?q?=E8=A6=81=E7=B4=A0=E3=82=92=E5=8F=96=E5=BE=97=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BveTypes/ClassWrappers/Public/MapObjectList.cs | 14 +++++++++++++- Libs/BveTypes/WrapTypes/5.8.7554.391.xml | 1 + Libs/BveTypes/WrapTypes/6.0.7554.619.xml | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Libs/BveTypes/ClassWrappers/Public/MapObjectList.cs b/Libs/BveTypes/ClassWrappers/Public/MapObjectList.cs index a4eb6e6a..9fa03c6d 100644 --- a/Libs/BveTypes/ClassWrappers/Public/MapObjectList.cs +++ b/Libs/BveTypes/ClassWrappers/Public/MapObjectList.cs @@ -28,6 +28,7 @@ private static void Initialize(BveTypeSet bveTypes) CurrentIndexGetMethod = members.GetSourcePropertyGetterOf(nameof(CurrentIndex)); CurrentIndexSetMethod = members.GetSourcePropertySetterOf(nameof(CurrentIndex)); + GoToAndGetCurrentMethod = members.GetSourceMethodOf(nameof(GoToAndGetCurrent)); GoToMethod = members.GetSourceMethodOf(nameof(GoTo)); } @@ -61,11 +62,22 @@ public int CurrentIndex set => CurrentIndexSetMethod.Invoke(Src, new object[] { value }); } + private static FastMethod GoToAndGetCurrentMethod; + /// + /// コレクションの指定した距離程に対応する要素へ移動し、それを取得します。 + /// + /// 移動先の距離程 [m]。 + public MapObjectBase GoToAndGetCurrent(double location) + { + object src = GoToAndGetCurrentMethod.Invoke(Src, new object[] { location }); + return src is null ? null : (MapObjectBase)CreateFromSource(src); + } + private static FastMethod GoToMethod; /// /// 指定したインデックスへ移動します。 /// - /// + /// 移動先のインデックス。 public void GoTo(int index) => GoToMethod.Invoke(Src, new object[] { index }); } } diff --git a/Libs/BveTypes/WrapTypes/5.8.7554.391.xml b/Libs/BveTypes/WrapTypes/5.8.7554.391.xml index 3f3c3e26..f85a4c9e 100644 --- a/Libs/BveTypes/WrapTypes/5.8.7554.391.xml +++ b/Libs/BveTypes/WrapTypes/5.8.7554.391.xml @@ -464,6 +464,7 @@ + diff --git a/Libs/BveTypes/WrapTypes/6.0.7554.619.xml b/Libs/BveTypes/WrapTypes/6.0.7554.619.xml index 3f3c3e26..f85a4c9e 100644 --- a/Libs/BveTypes/WrapTypes/6.0.7554.619.xml +++ b/Libs/BveTypes/WrapTypes/6.0.7554.619.xml @@ -464,6 +464,7 @@ +