コード例 #1
0
 private bool IsValidPlacing(ObservableStack<TowerPlate> tower,
                             TowerPlate plate) =>
                         tower.Count != 0 ? tower.Peek() > plate : true;
コード例 #2
0
 public void OnAmountOfPlatesChanged(object sender,
                             PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "AmountOfPlates")
     {
         firstTower.Clear();
         secondTower.Clear();
         thirdTower.Clear();
         winTower.Clear();
         for (int i = AmountOfPlates; i > 0; i--)
         {
             var plate = new TowerPlate() { Weight = i };
             firstTower.Push(plate);
             winTower.Push(plate);
         }
     }
 }