Skip to content

Commit

Permalink
feat: [クラスラッパー]カメラの位置に関する情報を編集できるように
Browse files Browse the repository at this point in the history
  • Loading branch information
automatic9045 committed Sep 9, 2023
1 parent 0124454 commit 15c602c
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions Libs/BveTypes/BveTypes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<Compile Include="ClassWrappers\Public\BrakeSystem.cs" />
<Compile Include="ClassWrappers\Public\BveFile.cs" />
<Compile Include="ClassWrappers\Public\CabBase.cs" />
<Compile Include="ClassWrappers\Public\CameraLocation.cs" />
<Compile Include="ClassWrappers\Public\Cant.cs" />
<Compile Include="ClassWrappers\Public\CantList.cs" />
<Compile Include="ClassWrappers\Public\CarBc.cs" />
Expand Down
39 changes: 39 additions & 0 deletions Libs/BveTypes/ClassWrappers/Public/CameraLocation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using FastMember;
using TypeWrapping;

namespace BveTypes.ClassWrappers
{
/// <summary>
/// カメラの位置に関する情報を提供します。
/// </summary>
public class CameraLocation : ClassWrapperBase
{
[InitializeClassWrapper]
private static void Initialize(BveTypeSet bveTypes)
{
ClassMemberSet members = bveTypes.GetClassInfoOf<CameraLocation>();
}

/// <summary>
/// オリジナル オブジェクトから <see cref="CameraLocation"/> クラスの新しいインスタンスを初期化します。
/// </summary>
/// <param name="src">ラップするオリジナル オブジェクト。</param>
protected CameraLocation(object src) : base(src)
{
}

/// <summary>
/// オリジナル オブジェクトからラッパーのインスタンスを生成します。
/// </summary>
/// <param name="src">ラップするオリジナル オブジェクト。</param>
/// <returns>オリジナル オブジェクトをラップした <see cref="CameraLocation"/> クラスのインスタンス。</returns>
[CreateClassWrapperFromSource]
public static CameraLocation FromSource(object src) => src is null ? null : new CameraLocation(src);
}
}
12 changes: 12 additions & 0 deletions Libs/BveTypes/ClassWrappers/Public/Vehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ private static void Initialize(BveTypeSet bveTypes)

DynamicsGetMethod = members.GetSourcePropertyGetterOf(nameof(Dynamics));
DynamicsSetMethod = members.GetSourcePropertySetterOf(nameof(Dynamics));

CameraLocationField = members.GetSourceFieldOf(nameof(CameraLocation));
}

/// <summary>
Expand Down Expand Up @@ -100,5 +102,15 @@ public VehicleDynamics Dynamics
get => VehicleDynamics.FromSource(DynamicsGetMethod.Invoke(Src, null));
set => DynamicsSetMethod.Invoke(Src, new object[] { value.Src });
}

private static FastField CameraLocationField;
/// <summary>
/// カメラの位置に関する情報を取得・設定します。
/// </summary>
public CameraLocation CameraLocation
{
get => ClassWrappers.CameraLocation.FromSource(CameraLocationField.GetValue(Src));
set => CameraLocationField.SetValue(Src, value.Src);
}
}
}
5 changes: 5 additions & 0 deletions Libs/BveTypes/WrapTypes/5.8.7554.391.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
</Property>
</Class>

<Class Wrapper="CameraLocation" Original="bi">
</Class>

<Class Wrapper="Cant" Original="c9">
<Property Wrapper="RotationZ">
<Getter Original="a"/>
Expand Down Expand Up @@ -1114,6 +1117,8 @@
<Getter Original="g"/>
<Setter Original="a"/>
</Property>

<Field WrapperProperty="CameraLocation" Original="q" IsOriginalNonPublic="true"/>
</Class>

<Class Wrapper="VehicleBogieWheel" Original="b7">
Expand Down
5 changes: 5 additions & 0 deletions Libs/BveTypes/WrapTypes/6.0.7554.619.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
</Property>
</Class>

<Class Wrapper="CameraLocation" Original="bi">
</Class>

<Class Wrapper="Cant" Original="c9">
<Property Wrapper="RotationZ">
<Getter Original="a"/>
Expand Down Expand Up @@ -1114,6 +1117,8 @@
<Getter Original="g"/>
<Setter Original="a"/>
</Property>

<Field WrapperProperty="CameraLocation" Original="q" IsOriginalNonPublic="true"/>
</Class>

<Class Wrapper="VehicleBogieWheel" Original="b7">
Expand Down

0 comments on commit 15c602c

Please sign in to comment.