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 15c602c commit df0c28c
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 2 deletions.
1 change: 1 addition & 0 deletions Libs/BveTypes/BveTypes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<Compile Include="ClassWrappers\Public\GraphCurvePoint.cs" />
<Compile Include="ClassWrappers\Public\MyTrack.cs" />
<Compile Include="ClassWrappers\Public\Passenger.cs" />
<Compile Include="ClassWrappers\Public\Passenger.StationProcess.cs" />
<Compile Include="ClassWrappers\Public\SideDoorSet.cs" />
<Compile Include="ClassWrappers\Public\SixDof.cs" />
<Compile Include="ClassWrappers\Public\Sound.SoundPosition.cs" />
Expand Down
37 changes: 37 additions & 0 deletions Libs/BveTypes/ClassWrappers/Public/Passenger.StationProcess.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BveTypes.ClassWrappers
{
public partial class Passenger
{
/// <summary>
/// 停車場における自列車の乗客の乗降の進捗を指定します。
/// </summary>
public enum StationProcess
{
/// <summary>
/// 乗降が開始されていないことを指定します。
/// </summary>
Ready,

/// <summary>
/// 降車中であることを指定します。
/// </summary>
Alighting,

/// <summary>
/// 乗車中であることを指定します。
/// </summary>
Boarding,

/// <summary>
/// 乗降が完了したことを指定します。
/// </summary>
Completed,
}
}
}
12 changes: 10 additions & 2 deletions Libs/BveTypes/ClassWrappers/Public/Passenger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
namespace BveTypes.ClassWrappers
{
/// <summary>
/// 乗客の動作をシミュレートします
/// 自列車の乗客を表します
/// </summary>
public class Passenger : ClassWrapperBase
public partial class Passenger : ClassWrapperBase
{
[InitializeClassWrapper]
private static void Initialize(BveTypeSet bveTypes)
{
ClassMemberSet members = bveTypes.GetClassInfoOf<Passenger>();

StateGetMethod = members.GetSourcePropertyGetterOf(nameof(State));
}

/// <summary>
Expand All @@ -35,5 +37,11 @@ protected Passenger(object src) : base(src)
/// <returns>オリジナル オブジェクトをラップした <see cref="Passenger"/> クラスのインスタンス。</returns>
[CreateClassWrapperFromSource]
public static Passenger FromSource(object src) => src is null ? null : new Passenger(src);

private static FastMethod StateGetMethod;
/// <summary>
/// 停車場における乗降の進捗を取得します。
/// </summary>
public StationProcess State => (StationProcess)StateGetMethod.Invoke(Src, null);
}
}
7 changes: 7 additions & 0 deletions Libs/BveTypes/WrapTypes/5.8.7554.391.xml
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,13 @@
</Class>

<Class Wrapper="Passenger" Original="a9">
<Children>
<Enum Wrapper="StationProcess" Original="a"/>
</Children>

<Property Wrapper="State">
<Getter Original="g"/>
</Property>
</Class>

<Class Wrapper="PluginLoader" Original="aa">
Expand Down
7 changes: 7 additions & 0 deletions Libs/BveTypes/WrapTypes/6.0.7554.619.xml
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,13 @@
</Class>

<Class Wrapper="Passenger" Original="a9">
<Children>
<Enum Wrapper="StationProcess" Original="a"/>
</Children>

<Property Wrapper="State">
<Getter Original="g"/>
</Property>
</Class>

<Class Wrapper="PluginLoader" Original="aa">
Expand Down

0 comments on commit df0c28c

Please sign in to comment.