-
-
Save whazor/fe520bc75f10b7ff2646 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blaat { | |
private readonly Waiter<Pion> _pionCompletion = new Waiter<Pion>(); | |
private void PionKlik(Pion item) | |
{ | |
_pionCompletion.Return(item); | |
} | |
public async Task<Pion> KiesPion(Func<Pion, bool> mogelijk) | |
{ | |
while (true) | |
{ | |
var pion = await _pionCompletion.Wait(); | |
if (mogelijk(pion)) | |
return pion; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment