예제 #1
0
        public void TestParsePhaseTest2()
        {
            var lines = File.ReadLines("PhaseTest2.txt").AsParserLines();

            var defs = mScriptParser.Deserialize <PhaseDef>(lines).ToArray();

            ZAssert.IsValidItems(defs, item =>
            {
                SceneAssert.IsValidPhase(item, null, action =>
                {
                    SceneAssert.IsValidDialogue(action, "PATIENT", "My… chest…");
                }, action =>
                {
                    SceneAssert.IsValidDialogue(action, "DANTE", "Quickly cut off the shirt.\nLet’s see what we’re dealing with here.");
                }, action =>
                {
                    SceneAssert.IsValidGunkIndices(action, "SCALPEL", new [] { 1 });
                });
            });
            //
            // SceneAssert.IsValidPhase(phaseDef,
            //     null,
            //     action =>
            //     {
            //         SceneAssert.IsValidDialogue(action, "PATIENT", "My… chest…");
            //     }, action =>
            //     {
            //         SceneAssert.IsValidDialogue(action, "DANTE", "Quickly cut off the shirt.\n" +
            //                                                      "Let’s see what we’re dealing with here.");
            //     }, action =>
            //     {
            //         SceneAssert.IsValidGunkIndices(action, "SCALPEL", new[]{1});
            //     });
        }
예제 #2
0
        public void TestParsePhaseTest1()
        {
            // var lines = LineUtil.GetLinesFromFile("PatientTest.txt").AsParserLines();

            var lines = File.ReadLines("PatientTest.txt").AsParserLines();

            PatientDef patientDef = mScriptParser.Deserialize <PatientDef>(lines).First();

            // PatientDef patientDef = mParseProcess.Deserialize<PatientDef>(lines).First();

            SceneAssert.IsValidPatient(patientDef,
                                       1,
                                       "Hank H.",
                                       new Vitals
            {
                Max      = 60,
                Starting = 40,
            }, (phase) =>
            {
                SceneAssert.IsValidPhase(phase, "chest_shirt_01",
                                         action =>
                {
                    SceneAssert.IsValidGunkInit(action, "WOUND_GLASS", 5);
                });
            },
                                       (phase) =>
            {
                SceneAssert.IsValidPhase(phase, null,
                                         action =>
                {
                    SceneAssert.IsValidDialogue(action, "PATIENT", "My… chest…");
                },
                                         action =>
                {
                    SceneAssert.IsValidDialogue(action, "DANTE", "Quickly cut off the shirt.\n" +
                                                "Let’s see what we’re dealing with here.");
                },
                                         action =>
                {
                    SceneAssert.IsValidGunkIndices(action, "SCALPEL", new [] { 1 });
                });
            },
                                       (phase) =>
            {
                SceneAssert.IsValidPhase(phase, "chest_01",
                                         action =>
                {
                    SceneAssert.IsValidGunkInit(action, "WOUND_STEEL_SMALL", 2);
                },
                                         action =>
                {
                    SceneAssert.IsValidGunkInit(action, "WOUND_CUT_LARGE", 2);
                },
                                         action =>
                {
                    SceneAssert.IsValidGunkInit(action, "WOUND_CUT_SMALL", 3);
                });
            });
            // Assert.AreEqual(1, patientDef.Id);
            // Assert.AreEqual("Hank H.", patientDef.Name);
            // Assert.AreEqual(new Vitals
            // {
            //     Max = 60,
            //     Starting = 40,
            // }, patientDef.Vitals);
            //
            // ZAssert.IsValidItems(patientDef.PhaseDefs, (phase) =>
            //     {
            //         SceneAssert.IsValidPhase(phase, "chest_shirt_01",
            //             action =>
            //         {
            //             SceneAssert.IsValidGunkInit(action, "WOUND_GLASS", 5);
            //         });
            //     },
            //     (phase) =>
            //     {
            //         SceneAssert.IsValidPhase(phase, null,
            //             action =>
            //             {
            //                 SceneAssert.IsValidDialogue(action, "PATIENT", "My… chest…");
            //             },
            //             action =>
            //             {
            //                 SceneAssert.IsValidDialogue(action, "DANTE", "Quickly cut off the shirt.\n" +
            //                                                              "Let’s see what we’re dealing with here.");
            //             },
            //             action =>
            //             {
            //                 SceneAssert.IsValidGunkIndices(action, "SCALPEL", new []{1});
            //             });
            //     },
            //     (phase) =>
            //     {
            //         SceneAssert.IsValidPhase(phase, "chest_01",
            //             action =>
            //             {
            //                 SceneAssert.IsValidGunkInit(action, "WOUND_STEEL_SMALL", 2);
            //             },
            //             action =>
            //             {
            //                 SceneAssert.IsValidGunkInit(action, "WOUND_CUT_LARGE", 2);
            //             },
            //             action =>
            //             {
            //                 SceneAssert.IsValidGunkInit(action, "WOUND_CUT_SMALL", 3);
            //             });
            //     });
        }
예제 #3
0
        public void TestParse()
        {
            var lines = ZParse.File("sample-conditional-cutscene.txt");

            var cutscenes = mParser.Deserialize <CutSceneDef>(lines).ToArray();

            SceneAssert.IsValidCutScene(cutscenes[0],
                                        item =>
            {
                SceneAssert.IsValidLoveFocus(item, "DANTE");
            },
                                        item =>
            {
                SceneAssert.IsValidDialogue(item, "DANTE", "What's up?");
            },
                                        item =>
            {
                SceneAssert.IsValidLoveDelta(item, "DANTE", 1);
            },
                                        item =>
            {
                SceneAssert.IsValidLoveDelta(item, null, 1);
            },
                                        item => {
                SceneAssert.IsValidLoveMin(item, "DANTE", 2,
                                           item =>
                {
                    SceneAssert.IsValidDialogue((StageAction)item, null, "Cutie? :D");
                },
                                           item =>
                {
                    SceneAssert.IsValidExpression((StageAction)item, "DANTE", "blushing");
                },
                                           item =>
                {
                    SceneAssert.IsValidDialogue((StageAction)item, null, "I mean...");
                },
                                           item =>
                {
                    SceneAssert.IsValidMove((StageAction)item,
                                            SceneAssert.MoveAssertFactory("DANTE", 5));
                },
                                           item =>
                {
                    SceneAssert.IsValidDialogue((StageAction)item, null, "Not like I meant it");
                },
                                           item =>
                {
                    SceneAssert.IsValidLoveDelta((StageAction)item, "DANTE", -1);
                },
                                           item =>
                {
                    SceneAssert.IsValidLoveDelta((StageAction)item, null, -1);
                }
                                           );
            },
                                        item => {
                SceneAssert.IsValidLoveMin(item, null, 1,
                                           item =>
                {
                    SceneAssert.IsValidDialogue((StageAction)item, null, "Oh");
                }
                                           );
            },
                                        item =>
            {
                SceneAssert.IsValidDialogue(item, "PROTAG", "Nothing much");
            }
                                        );
        }