本文整理汇总了C#中FSM.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# FSM.Reset方法的具体用法?C# FSM.Reset怎么用?C# FSM.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSM
的用法示例。
在下文中一共展示了FSM.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogicShit
//private List<XmlWavEvent> pendingRussian;
public LogicShit(AudioRecManager recMan)
{
this.recMan = recMan;
FilenameFormat = DumpFolder + "/segment_{0}.wav";
#region FSM with XML
fsmWithXml = new FSM<Keys>()
.addNode_0_(LogicState.Ready)
.addEdge___(Keys.Enter, LogicState.DeqedLang1, (args) => {
IlyaXml = new XmlIlyaFrankAbook() {
Lang1Mp3Filename = Lang1Mp3,
Lang1Prefix = AudioBooker.classes.UtilsCore.GetFullPathWithoutExtension(Lang1Mp3)
};
new_paragraph();
nextLang1Phrase();
readCurLang1Phrase();
FireHandler(CurParagraphUpdated);
})
.addNode_0_(LogicState.DeqedLang1)
.addEdge___(Keys.R, LogicState.DeqedLang1, (args) => readCurLang1Phrase())
.addEdge___(Keys.P, LogicState.DeqedLang1, (args) => {
purgeParaAllExceptLast();
FireHandler(CurParagraphUpdated);
})
.addEdge___(Keys.Space, LogicState.Recording1st, (args) => {
startSegment();
FireHandler(CurSegmentUpdated);
FireHandler(CurParagraphUpdated);
})
.addNode_0_(LogicState.Recording1st)
.addEdge___(Keys.R, LogicState.Recording1st, (args) => readCurLang1Phrase())
.addEdge___(Keys.P, LogicState.DeqedLang1, (args) => {
purgeParaAllExceptLast();
stopAndDeleteSegment();
FireHandler(CurSegmentUpdated);
FireHandler(CurParagraphUpdated);
})
.addEdge___(Keys.Back, LogicState.Recording1st, (args) => {
stopAndDeleteSegment();
startSegment();
FireHandler(CurSegmentUpdated);
})
.addEdge___(Keys.Space, LogicState.RecordingMore, (args) => {
commitSegment();
startSegment();
FireHandler(CurParagraphUpdated);
FireHandler(CurSegmentUpdated);
})
.addNode_0_(LogicState.RecordingMore)
.addEdge___(Keys.R, LogicState.RecordingMore, (args) => readCurLang1Phrase())
.addEdge___(Keys.Back, LogicState.RecordingMore, (args) => {
stopAndDeleteSegment();
startSegment();
FireHandler(CurSegmentUpdated);
})
.addEdge___(Keys.Space, LogicState.RecordingMore, (args) => {
commitSegment();
startSegment();
FireHandler(CurParagraphUpdated);
FireHandler(CurSegmentUpdated);
})
.addEdge___(Keys.D1, LogicState.RecordingMore, (args) => {
stopAndDeleteSegment();
RecordedSegments = CurIlyaSentence.Lang1Segments;
startSegment();
FireHandler(CurParagraphUpdated);
FireHandler(CurSegmentUpdated);
})
.addEdge___(Keys.D2, LogicState.RecordingMore, (args) => {
stopAndDeleteSegment();
RecordedSegments = CurIlyaSentence.Lang2Segments;
startSegment();
FireHandler(CurParagraphUpdated);
FireHandler(CurSegmentUpdated);
})
.addEdge___(Keys.Enter, LogicState.DeqedLang1, (args) => {
stopAndDeleteSegment();
nextLang1Phrase();
readCurLang1Phrase();
FireHandler(CurSegmentUpdated);
FireHandler(CurParagraphUpdated);
})
.addEdge___(Keys.P, LogicState.CommitedParagraph, (args) => {
stopAndDeleteSegment();
new_paragraph();
FireHandler(CurSegmentUpdated);
FireHandler(CurParagraphUpdated);
})
.addNode_0_(LogicState.CommitedParagraph)
.addEdge___(Keys.Enter, LogicState.DeqedLang1, (args) => {
nextLang1Phrase();
readCurLang1Phrase();
FireHandler(CurSegmentUpdated);
FireHandler(CurParagraphUpdated);
})
;
fsmWithXml.Reset();
//.........这里部分代码省略.........