Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Bizzycola : Person
- {
- Timer foodTimer;
- Timer sleepTimer;
- bool sleeping = false;
- public static void Main(string[] args)
- {
- foodTimer = new Timer(15000); //eat every 15 seconds, very important to maintain ability to bother gamax
- foodTimer.Elapsed += delegate{ if(!sleeping){base.Eat(base.FindNearestFood());} };
- foodTimer.Start();
- sleepTimer = new Timer(120000); //sleep every few minutes, also important, Bizzycola is a rather lazy extension of the original person
- sleepTimer.Elapsed += delegate{ sleeping = true; Thread.CurrentThread.Sleep(300000); sleeping = false; annoy(People.FindFromName("gamax92"); };
- sleepTimer.Start();
- annoy(People.FindFromName("gamax92");
- }
- public static void annoy(Person person)
- {
- while(!sleeping)
- {
- person.bother();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement