-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathteTriangle.cs
More file actions
36 lines (29 loc) · 973 Bytes
/
teTriangle.cs
File metadata and controls
36 lines (29 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
namespace TankLib.Math {
[StructLayout(LayoutKind.Sequential, Pack = 4)]
[DebuggerDisplay("A: {IndexA}, B: {IndexB}, C: {IndexC}")]
public struct teTriangle {
/// <summary>Index 1</summary>
public int IndexA;
/// <summary>Index 2</summary>
public int IndexB;
/// <summary>Index 3</summary>
public int IndexC;
public teTriangle(ushort indexA, ushort indexB, ushort indexC) {
IndexA = (int) indexA;
IndexB = (int) indexB;
IndexC = (int) indexC;
}
public teTriangle(IReadOnlyList<ushort> val) {
if (val.Count != 3) {
throw new InvalidDataException();
}
IndexA = val[0];
IndexB = val[1];
IndexC = val[2];
}
}
}