예제 #1
0
 public void PointsChanged(MasteryIcon src, int amount) {
   Points = 0;
   Points = Rows.Sum(r => r.Points);
   PointChanged?.Invoke(src, Points);
 }
예제 #2
0
 public void Add(MasteryIcon icon) {
   Icons.Add(icon);
   Control.Children.Add(icon);
 }
예제 #3
0
 public void PointsChanged(MasteryIcon src, int amount) {
   if (Points > Ranks) {
     Icons.FirstOrDefault(item => item != src && item.Points >= Points - Ranks.Value).Points -= Points - Ranks.Value;
   }
   Tree.PointsChanged(src, Points);
 }
예제 #4
0
    private void CreateTree(MasteryTree tree, List<List<MasteryTreeDto.BranchDto>> src, int col) {
      tree.Control.Rows = src.Count;
      tree.Control.Columns = 1;
      for (int y = 0; y < src.Count; y++) {
        var row = new MasteryRow(y, tree);
        row.Control.Columns = src[y].Count;
        for (int x = 0; x < src[y].Count; x++) {
          var item = src[y][x];
          if (item == null) row.AddBlank();
          else {
            var icon = new MasteryIcon(DataDragon.MasteryData.Value.data[item.masteryId], row);
            icon.MouseEnter += Icon_MouseEnter;
            icon.MouseLeave += Icon_MouseLeave;
            icon.Margin = new Thickness(HorizontalSpace / 2, 0, HorizontalSpace / 2, 0);

            Icons.Add(item.masteryId, icon);
            row.Add(icon);
          }
        }
        tree.Add(row);
      }
      tree.PointChanged += (s, p) => CheckPoints();
      //tree.Control.Height = src.Count * (ImageSize + ImageBorder * 2 + VerticalSpace) + VerticalSpace;
    }