Exemple #1
0
 public LadderModel(LadderProcess ladder)
 {
     steps = ladder.OrderedLadderImplants
             .Concat(ladder.OrderedFinalImplants)
             .Select(i => new StepModel(i))
             .ToArray();
     AverageFinalImplantQL = ladder.AverageFinalImplantQL;
 }
Exemple #2
0
        public void CountsAllPossibleEquipOrdersForOneImplantTemplate()
        {
            var implantTemplates = new[]
            {
                ImplantSlot.Head.ImplantTemplates.First()
            };

            Assert.AreEqual(1, LadderProcess.GetAllPossibleEquipOrders(implantTemplates).ToArray().Length);
        }
Exemple #3
0
        public void CountsAllPossibleEquipOrdersForFourImplantTemplates()
        {
            var implantTemplates = new[]
            {
                ImplantSlot.Head.ImplantTemplates.First(),
                ImplantSlot.Eye.ImplantTemplates.First(),
                ImplantSlot.Ear.ImplantTemplates.First(),
                ImplantSlot.Chest.ImplantTemplates.First()
            };

            Assert.AreEqual(24, LadderProcess.GetAllPossibleEquipOrders(implantTemplates).ToArray().Length);
        }
Exemple #4
0
        public async Task InitializeLadderProcess()
        {
            if (HasBuiltLadderProcess)
            {
                return;
            }

            Debug.WriteLine("Building ladder process...");
            // Browsers are single-threaded so this will actually still block the UI.
            // See: https://github.com/aspnet/Blazor/issues/560
            LadderProcess ladder = await Task.Run(() => Build.CreateLadderProcess());

            Debug.WriteLine("Ladder process built.");
            Ladder                = new LadderModel(ladder);
            Shopping              = new ShoppingModel(ladder);
            ExportToAuno          = new ExportToAunoModel(ladder);
            HasBuiltLadderProcess = true;
        }
Exemple #5
0
 public ShoppingModel(LadderProcess ladder)
 {
     ShinyClusters = ladder.OrderedLadderImplants
                     .Concat(ladder.OrderedFinalImplants)
                     .Where(i => i.ShinyClusterTemplate != null)
                     .Select(i => new ClusterModel(i.MinimumShinyClusterQL.Value, i.ShinyStat))
                     .OrderBy(c => c.Stat).ThenBy(c => c.MinimumQL)
                     .ToArray();
     BrightClusters = ladder.OrderedLadderImplants
                      .Concat(ladder.OrderedFinalImplants)
                      .Where(i => i.BrightClusterTemplate != null)
                      .Select(i => new ClusterModel(i.MinimumBrightClusterQL.Value, i.BrightStat))
                      .OrderBy(c => c.Stat).ThenBy(c => c.MinimumQL)
                      .ToArray();
     FadedClusters = ladder.OrderedLadderImplants
                     .Concat(ladder.OrderedFinalImplants)
                     .Where(i => i.FadedClusterTemplate != null)
                     .Select(i => new ClusterModel(i.MinimumFadedClusterQL.Value, i.FadedStat))
                     .OrderBy(c => c.Stat).ThenBy(c => c.MinimumQL)
                     .ToArray();
 }
 public ExportToAunoModel(LadderProcess ladder)
 {
     implants = ladder.OrderedFinalImplants
                .Select(i => new FinalImplant(i))
                .ToArray();
 }
Exemple #7
0
        public void VerifiesAllPossibleEquipOrders()
        {
            var equipOrders = new[]
            {
                new[]
                {
                    ImplantSlot.Head.ImplantTemplates.First(),
                ImplantSlot.Eye.ImplantTemplates.First(),
                ImplantSlot.Ear.ImplantTemplates.First(),
                },
                new[]
                {
                    ImplantSlot.Head.ImplantTemplates.First(),
                ImplantSlot.Ear.ImplantTemplates.First(),
                ImplantSlot.Eye.ImplantTemplates.First(),
                },
                new[]
                {
                    ImplantSlot.Ear.ImplantTemplates.First(),
                ImplantSlot.Head.ImplantTemplates.First(),
                ImplantSlot.Eye.ImplantTemplates.First(),
                },
                new[]
                {
                    ImplantSlot.Ear.ImplantTemplates.First(),
                ImplantSlot.Eye.ImplantTemplates.First(),
                ImplantSlot.Head.ImplantTemplates.First(),
                },
                new[]
                {
                    ImplantSlot.Eye.ImplantTemplates.First(),
                ImplantSlot.Ear.ImplantTemplates.First(),
                ImplantSlot.Head.ImplantTemplates.First(),
                },
                new[]
                {
                    ImplantSlot.Eye.ImplantTemplates.First(),
                ImplantSlot.Head.ImplantTemplates.First(),
                ImplantSlot.Ear.ImplantTemplates.First(),
                }
            };

            var matchedEquipOrderIndexes = new HashSet <int>();

            foreach (var equipOrder in LadderProcess.GetAllPossibleEquipOrders(new[]
            {
                ImplantSlot.Eye.ImplantTemplates.First(),
                ImplantSlot.Head.ImplantTemplates.First(),
                ImplantSlot.Ear.ImplantTemplates.First(),
            }))
            {
                for (int i = 0; i < equipOrders.Length; ++i)
                {
                    if (equipOrders[i].SequenceEqual(equipOrder))
                    {
                        Assert.IsTrue(matchedEquipOrderIndexes.Add(i));
                    }
                }
            }

            Assert.AreEqual(6, matchedEquipOrderIndexes.Count);
        }
Exemple #8
0
        public void CountsAllPossibleEquipOrdersForZeroImplantTemplates()
        {
            var implantTemplates = new ImplantTemplate[0];

            Assert.AreEqual(1, LadderProcess.GetAllPossibleEquipOrders(implantTemplates).ToArray().Length);
        }