scripts
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Poly2Tri
|
||||
{
|
||||
// Token: 0x0200001E RID: 30
|
||||
public struct FixedArray3<T> : IEnumerable<T>, IEnumerable where T : class
|
||||
{
|
||||
// Token: 0x17000028 RID: 40
|
||||
public T this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return this._0;
|
||||
case 1:
|
||||
return this._1;
|
||||
case 2:
|
||||
return this._2;
|
||||
default:
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
this._0 = value;
|
||||
return;
|
||||
case 1:
|
||||
this._1 = value;
|
||||
return;
|
||||
case 2:
|
||||
this._2 = value;
|
||||
return;
|
||||
default:
|
||||
throw new IndexOutOfRangeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060000E4 RID: 228 RVA: 0x000051C8 File Offset: 0x000033C8
|
||||
public bool Contains(T value)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (this[i] == value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Token: 0x060000E5 RID: 229 RVA: 0x000051F8 File Offset: 0x000033F8
|
||||
public int IndexOf(T value)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (this[i] == value)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Token: 0x060000E6 RID: 230 RVA: 0x00005228 File Offset: 0x00003428
|
||||
public void Clear()
|
||||
{
|
||||
this._0 = (this._1 = (this._2 = default(T)));
|
||||
}
|
||||
|
||||
// Token: 0x060000E7 RID: 231 RVA: 0x00005258 File Offset: 0x00003458
|
||||
public void Clear(T value)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (this[i] == value)
|
||||
{
|
||||
this[i] = default(T);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x060000E8 RID: 232 RVA: 0x00005295 File Offset: 0x00003495
|
||||
private IEnumerable<T> Enumerate()
|
||||
{
|
||||
int num;
|
||||
for (int i = 0; i < 3; i = num)
|
||||
{
|
||||
yield return this[i];
|
||||
num = i + 1;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
|
||||
// Token: 0x060000E9 RID: 233 RVA: 0x000052AA File Offset: 0x000034AA
|
||||
public IEnumerator<T> GetEnumerator()
|
||||
{
|
||||
return this.Enumerate().GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x060000EA RID: 234 RVA: 0x000052B7 File Offset: 0x000034B7
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
// Token: 0x04000050 RID: 80
|
||||
public T _0;
|
||||
|
||||
// Token: 0x04000051 RID: 81
|
||||
public T _1;
|
||||
|
||||
// Token: 0x04000052 RID: 82
|
||||
public T _2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user