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); }
private void OnUnitRemoved(BaseUnitModel removedUnit) { if (UnitRemoved != null) UnitRemoved(removedUnit); }
private void OnUnitAdded(BaseUnitModel addedUnit) { if (UnitAdded != null) UnitAdded(addedUnit); }
private void NonBirdCollisionEvent(object sender, BaseUnitModel collidingModel) { if (collidingModel.GetType() != typeof(BirdModel)) return; Stop(); }
private void BirdCollisionEvent(object sender, BaseUnitModel collidingModel) { Stop(); }
public void OnCollision(object sender, BaseUnitModel collidingUnit) { if (Collision != null) Collision(sender, collidingUnit); }