delegates and other fun things
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user