× Phaseshift FCOM Tutorials

Easy way to check attribute status for all instances of class in a list



The following describes an easy way to check if all properties within a List match a condition. It might be to check if all players in a List have the property isReady == true, so you can advance your game to the next step. Instead of iterating through with a foreach loop, you can use the .All method to determine the status of the property in a List using System.Linq.

Documentation


To explore more on these topics, check out the documentation:

Enumerable.All<TSource> Method

Liked this article?

Please consider sharing!
Author

Josh Lyell

Game Developer