delegates and other fun things

This commit is contained in:
2026-03-25 12:04:12 +01:00
parent c37d657bd0
commit 6f4184983d

View File

@@ -4,17 +4,15 @@ namespace PeopleVille
{ {
public class GameManager public class GameManager
{ {
List<Store> Stores { get; set; } public delegate void TickHandler();
public event TickHandler TickDone;
public async Task StartClock() public async Task StartClock()
{ {
var res = 0;
while (true) while (true)
{ {
Console.WriteLine($"{res}"); TickDone.Invoke();
res++;
// Do something
await Task.Delay(500); await Task.Delay(500);
} }
} }