forked from Shardstone/trail-into-darkness
updated linq calls to zero allocation zlinq
This commit is contained in:
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user