Changes

Jump to navigation Jump to search
→‎New C# utility methods: update for build 23310 (added RemoveWhere)
Line 7,734: Line 7,734:  
</syntaxhighlight>
 
</syntaxhighlight>
 
|}
 
|}
 +
 +
====Filtering====
 +
The game now has an optimized <samp>RemoveWhere</samp> method for O(n) filtering on <samp>NetCollection</samp>, <samp>NetDictionary</samp>, <samp>NetList</samp>, and (via extension) <samp>IDictionary</samp>. This also deprecates <samp>Filter</samp> methods where they existed.
 +
 +
For example:
 +
<syntaxhighlight lang="c#">
 +
int dirtTilesRemoved = Game1.currentLocation.terrainFeatures.RemoveWhere(pair => pair.Value is HoeDirt);
 +
</syntaxhighlight>
    
====Game paths====
 
====Game paths====
translators
8,456

edits

Navigation menu