daily update on 20240514 by nitload youmu

This commit is contained in:
YoumuLiu
2024-05-14 15:41:22 +08:00
parent a3506c96a3
commit 2e57126ab7
75 changed files with 3572 additions and 198 deletions
@@ -31,6 +31,7 @@
using StgSharp.Math;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.Contracts;
@@ -43,7 +44,7 @@ using System.Threading.Tasks;
namespace StgSharp.Geometries
{
public class PlainInstancingBuffer<T> : IDisposable where T : IInstancing<T>
public class PlainInstancingBuffer<T> : IDisposable,IEnumerable<T> where T : IInstancing<T>
{
private CoordinatePlain globalCorrdinnate;
@@ -158,7 +159,7 @@ namespace StgSharp.Geometries
{
foreach (var particle in instanceList)
{
particle.Move();
}
}
@@ -188,5 +189,21 @@ namespace StgSharp.Geometries
Dispose(disposing: true);
GC.SuppressFinalize(this);
}
public IEnumerator<T> GetEnumerator()
{
foreach (var item in instanceList)
{
yield return (T)item;
}
}
IEnumerator IEnumerable.GetEnumerator()
{
foreach (var item in instanceList)
{
yield return (T)item;
}
}
}
}