Going back to the canvas thing

This commit is contained in:
Lani Aung
2021-12-12 13:49:19 -07:00
parent 720b387dd3
commit 262bce4549
20 changed files with 3623 additions and 537 deletions
+1 -11
View File
@@ -1,4 +1,3 @@
using System;
using System.Linq;
using System.Text.Json.Serialization;
using fxl.codes.kisekae.Entities;
@@ -19,16 +18,7 @@ namespace fxl.codes.kisekae.Models
var totalCels = configuration.Cels.Count;
Cels = configuration.Cels.Select((x, index) => new CelModel(x, (totalCels - index) * 10)).ToArray();
var summation = configuration.Cels.Aggregate(Set.None, (current, cel) => current | cel.Sets);
if (summation == Set.None)
{
Array.Fill(Sets, true);
return;
}
foreach (var value in Enum.GetValues<Set>().Where(x => (x & summation) == x && x != Set.None))
if (value == Set.Zero) Sets[0] = true;
else Sets[(int)Math.Log2((double)value)] = true;
for (var index = 0; index < 10; index++) Sets[index] = configuration.Cels.Any(x => x.Positions.Any(y => y.Set == index));
}
public CelModel[] Cels { get; set; }