This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BuildTarget.cs
55 lines (48 loc) · 2.12 KB
/
BuildTarget.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using ShogunOptimizer.ArtifactSources;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
namespace ShogunOptimizer
{
public abstract class BuildTarget
{
public abstract bool UpgradeArtifactsToLvl20 { get; }
public abstract string EquippedTo { get; }
public abstract bool AllowUnequipped { get; }
public abstract bool UseGeneratedArtifacts { get; }
public abstract Type[] UsefulSets { get; }
public abstract StatType[] UsefulMainStats { get; }
public abstract StatType[] UsefulSubStats { get; }
public abstract void Initialize(out Character character, out Enemy enemy, out ICollection<Weapon> weapons);
public abstract ReadOnlyDictionary<Type, object> GetConfigs();
public void FilterArtifacts(ArtifactSource artifactSource)
{
artifactSource.Sands.RemoveAll(p => !UsefulMainStats.Contains(p.Stats[0].Item1));
artifactSource.Goblets.RemoveAll(p => !UsefulMainStats.Contains(p.Stats[0].Item1));
artifactSource.Circlets.RemoveAll(p => !UsefulMainStats.Contains(p.Stats[0].Item1));
}
public abstract bool FilterBuild(Build build, Character character, Enemy enemy);
public abstract double Evaluate(Build build, Character character, Enemy enemy);
public abstract void DisplayResults(Build build, Character character, Enemy enemy);
public virtual ArtifactSource ImportArtifacts()
{
var importer = new GoImporter(UpgradeArtifactsToLvl20);
importer.Import("../../Debug/net5.0/godata.json", EquippedTo, AllowUnequipped);
FilterArtifacts(importer);
return importer;
}
public virtual ArtifactSource GenerateArtifacts(double rollFactor)
{
var generator = new ArtifactGenerator
{
Sets = UsefulSets,
MainStats = UsefulMainStats,
SubStats = UsefulSubStats,
RollFactor = rollFactor,
};
generator.Generate();
return generator;
}
}
}