Exemplo n.º 1
0
        internal void Meet(Reindeer reindeer)
        {
            lock (ReindeerGroup)
            {
                ReindeerGroup.Add(reindeer);

                if (ReindeerGroup.Count == 9)
                {
                    var awakeMessage = new ReindeerAwakeMessage(ReindeerGroup.ToList());

                    foreach (var reindeerToRemove in awakeMessage.Group)
                    {
                        ReindeerGroup.Remove(reindeerToRemove);
                    }

                    Santa.Awake(awakeMessage);
                }
            }
        }
Exemplo n.º 2
0
 public void Tie(Reindeer reindeer)
 {
     Reindeers.Add(reindeer);
     reindeer.Sleigh = this;
 }