Beispiel #1
0
        private void _model_BeeMoved(object sender, BeeMovedEventArgs e)
        {
            Bee beeThatMoved = e.BeeThatMoved;
            if (_bees.ContainsKey(beeThatMoved))
            {
                AnimatedImage beeAnimatedImage = BeeStarHelper.BeeFactory(beeThatMoved.Width, beeThatMoved.Height,
                    TimeSpan.FromMilliseconds(50));
                BeeStarHelper.SetCanvasLocation(beeAnimatedImage, e.X, e.Y);

                _bees[beeThatMoved] = beeAnimatedImage;
                _sprites.Add(beeAnimatedImage);
            }
            else
            {
                BeeStarHelper.MoveElementOnCanvas(_bees[beeThatMoved],
                    e.X, e.Y);
            }
        }
Beispiel #2
0
 private void OnBeeMoved(BeeMovedEventArgs e)
 {
     var beeMovedEventHandler = BeeMoved;
     if (beeMovedEventHandler != null)
     {
         beeMovedEventHandler(this, e);
     }
 }