Untitled
unknown
plain_text
2 years ago
905 B
2
Indexable
using Piskvorky_JanNeuC3a; using System; using System.Numerics; using System.Threading; using System.Threading.Tasks; namespace Piskvorky_JanNeuC3a { class HumanPlayer : Player { private CancellationTokenSource _cts; protected override Task MakeTurnAsync() { _cts = new CancellationTokenSource(); var token = _cts.Token; var task = Task.Factory.StartNew( () => { while (true) { if (token.IsCancellationRequested) { break; } } } ); return task; } public override void OnPlayerMoved() { _cts?.Cancel(); } } }
Editor is loading...