Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SnakeOOP2b
- {
- public delegate void TickEventHandler(object sender, EventArgs e);
- class Timer
- {
- public event TickEventHandler Tick;
- private void OnTick(EventArgs e)
- {
- if (Tick != null)
- {
- Tick(this, e);
- }
- }
- public void Start()
- {
- while(true)
- {
- OnTick(EventArgs.Empty);
- System.Threading.Thread.Sleep(100);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment