Пример #1
0
 private void UnitAdded(BaseUnitModel unit)
 {
     UnitViewModel newUnitViewModel = new UnitViewModel(unit.Id);
     newUnitViewModel.Width = unit.DisplayWidth;
     newUnitViewModel.Height = unit.DisplayHeight;
     newUnitViewModel.DisplayPosition = unit.DisplayPosition;
     newUnitViewModel.Type = unit.Type;
     UnitViewModelCollection.Add(newUnitViewModel);
     UnitIdViewModelDictionary.Add(newUnitViewModel.Id, newUnitViewModel);
 }
Пример #2
0
 private void OnUnitRemoved(BaseUnitModel removedUnit)
 {
     if (UnitRemoved != null)
         UnitRemoved(removedUnit);
 }
Пример #3
0
 private void OnUnitAdded(BaseUnitModel addedUnit)
 {
     if (UnitAdded != null)
         UnitAdded(addedUnit);
 }
Пример #4
0
 private void NonBirdCollisionEvent(object sender, BaseUnitModel collidingModel)
 {
     if (collidingModel.GetType() != typeof(BirdModel)) return;
     Stop();
 }
Пример #5
0
 private void BirdCollisionEvent(object sender, BaseUnitModel collidingModel)
 {
     Stop();
 }
Пример #6
0
 public void OnCollision(object sender, BaseUnitModel collidingUnit)
 {
     if (Collision != null)
         Collision(sender, collidingUnit);
 }