예제 #1
0
 protected void OnStarChanged(Star starThatChanged, bool removed)
 {
     EventHandler<StarChangedEventArgs> starChanged = StarChanged;
     if (starChanged != null)
     {
         starChanged(this, new StarChangedEventArgs(starThatChanged, removed));
     }
 }
예제 #2
0
        private void MoveOneStar(Star star = null)
        {
            if (_stars.Keys.Count == 0)
            {
                return;
            }
            else if (star == null)
            {
                star = _stars.Keys.ToList()[_random.Next(_stars.Count)];
            }

            star.Location = FindNonOverlappingPoint(StarSize);
            OnStarChanged(star, removed: false);
        }
예제 #3
0
        private void CreateAStar()
        {
            Point starLocation = FindNonOverlappingPoint(StarSize);

            Star newStar = new Star(starLocation);
            _stars.Add(newStar, starLocation);

            OnStarChanged(newStar, removed: false);
        }
예제 #4
0
 public StarChangedEventArgs(Star starThatChanged, bool removed)
 {
     StarThatChanged = starThatChanged;
     Removed = removed;
 }
예제 #5
0
 private void CreateAStar()
 {
     Point newLocation = FindNonOverlappingPoint(StarSize);
     Star newStar = new Star(newLocation);
     _stars[newStar] = new Point(newLocation.X, newLocation.Y);
     OnStarChanged(newStar, false);
 }
예제 #6
0
 public StarChangedEventArgs(Star starThatChanged, bool removed)
 {
     StarThatChanged = starThatChanged;
     Removed         = removed;
 }