小编D-B*_*ett的帖子

将Pascal'type'转换为C#

我正在尝试将Pascal类型转换为C#.我在谷歌上看了一下,但我没有设法找到答案,可能是因为我没有正确搜索,所以很抱歉,如果这是重复的话.

我有这两种Pascal类型:

type
  TVector3i = array [0..2] of longint;

  Tcolface = packed record
    A, B, C: word;
    SurfaceA, SurfaceB: word;
  end;
Run Code Online (Sandbox Code Playgroud)

我知道

Tcolface = packed record
  A, B, C: word;
  SurfaceA, SurfaceB: word;
end;
Run Code Online (Sandbox Code Playgroud)

转换为:

struct Tcolface {
  ushort A, B, C;
  ushort SurfaceA, SurfaceB;
}
Run Code Online (Sandbox Code Playgroud)

但如何TVector3i = array [0..2] of longint;转换?

我试图避免使用/编写一个类,因为当我转换其余的Pascal代码时,它将期望该类型作为数组,并且我试图避免将其转换为.x .y和.z.

我确实考虑过这样做float[] variablename = new float[3];,但是一旦得到List<float[]> variblename它就会变得更加复杂.

完整的代码是:

TVector3i = array [0..2] of Longint;
TVector3f = array [0..2] of Single;
TVector3d …
Run Code Online (Sandbox Code Playgroud)

c# delphi pascal converter

4
推荐指数
2
解决办法
900
查看次数

标签 统计

c# ×1

converter ×1

delphi ×1

pascal ×1