/
EugenyCh7
/
Puppet2D.Net
Обзор
Документация
Войти
/
EugenyCh7
/
Puppet2D.Net
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Puppet2D.Engine/Internal.cs
36 строк
1 KB
Eugeny Chekmarev
- namespace Puppet2D.Physics.Native
21 авг 2025, 17:48
21 авг 2025, 17:48
33226da
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Runtime.CompilerServices; namespace Puppet2D.Engine { internal static class Internal { [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static Version Cast(this B2.Version version) { return new Version(version.major, version.minor, version.revision); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void ForEach<T>(this IEnumerable<T> items, Action<T> action) { foreach (T item in items) { action.Invoke(item); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void ForEachIf<T>(this IEnumerable<T> items, Predicate<T> condition, Action<T> action) { foreach (T item in items) { if (condition.Invoke(item)) { action.Invoke(item); } } } } }