updated linq calls to zero allocation zlinq

This commit is contained in:
Sebastian Bularca
2026-04-02 09:12:37 +02:00
parent 36d3f112ef
commit 530ffef338
16 changed files with 131 additions and 131 deletions

View File

@@ -1,5 +1,5 @@
using System;
using System.Linq;
using ZLinq;
namespace Nox.Game {
public interface ICharacterStatsFactory {
@@ -18,7 +18,7 @@ namespace Nox.Game {
public EntityStats Create(IEntityDefinition entityDefinition) {
var attributes = entityDefinition.Attributes;
if(attributes.attributes.Any(a => a.value <= 0)) {
if(attributes.attributes.AsValueEnumerable().Any(a => a.value <= 0)) {
throw new ArgumentOutOfRangeException( "attributes cannot be zero or negative.", new ArgumentException() );
}