コード例 #1
0
ファイル: TreeTests.cs プロジェクト: hbq0449/FFXIVSynthSolver
        public void TestUrgentCompletion2()
        {
            Analyzer       analyzer = new Analyzer();
            BasicSynthesis bs       = new BasicSynthesis();
            SteadyHand     sh       = new SteadyHand();

            analyzer.Actions.AddAction(bs);
            //analyzer.Actions.AddAction(new BasicTouch());
            //analyzer.Actions.AddAction(new MastersMend());
            analyzer.Actions.AddAction(sh);
            //analyzer.Actions.AddAction(new Observe());

            State state = Utility.CreateDefaultState();

            // Make sure we don't have enough CP to run Master's Mend.
            state.CP         = Compute.CP(SynthAction <SynthActionAttribute, MastersMend> .Attributes.CP, state) - 1;
            state.Durability = 20;

            // Make sure exactly 2 Basic Synthesis' are required to finish the synth.
            state.Progress    = 0;
            state.MaxProgress = 2 * Compute.Progress(state, bs.BaseEfficiency);

            analyzer.Run(state);

            // The best sequence is Steady Hand -> Basic Synthesis -> Basic Synthesis
            Simulator.Engine.Ability bestAction = analyzer.OptimalAction(state);
            Assert.AreEqual <Type>(typeof(SteadyHand), bestAction.GetType());

            state      = sh.Activate(state, true);
            bestAction = analyzer.OptimalAction(state);
            Assert.AreEqual <Type>(typeof(BasicSynthesis), bestAction.GetType());

            state      = bs.Activate(state, true);
            bestAction = analyzer.OptimalAction(state);
            Assert.AreEqual <Type>(typeof(BasicSynthesis), bestAction.GetType());

            state = bs.Activate(state, true);
            Assert.AreEqual(SynthesisStatus.COMPLETED, state.Status);
        }