#39 use ConversationParser in NPC fsm engine

None
closed-fixed
Martin Fuchs
None
5
2013-06-08
2007-12-05
Martin Fuchs
No

By moving the parsing code into Engine, the condition and action handlers get the pre-parsed sentence. The parsing is done in ConversationParser, so the quest classes can be freed from all word processing code.

Required changes involve:
- call ConversationParser in Engine
- replace the 'String text' parameter in PreTransitionCondition and PostTransitionAction by 'Sentence sentence'
- adjust all derived classes to be compatible with the new interfaces
- replace old text parsing code by using ConversationParser/Sentence

I successfully tried the code changes in my local working copy and ensured of unchanged functionality by running the JUnit tests.

The big advantage of this is, there is only one place where text parsing is done. This ensures a uniform user interface and consistent in-code handling. The parser class can be extended to handle even more complex input syntax in future without having to code it at various scattered places.

Discussion

  • Martin Fuchs
    Martin Fuchs
    2007-12-06

    Logged In: YES
    user_id=1534223
    Originator: YES

    File Added: Stendhal-parser-engine.patch.gz

     
  • Martin Fuchs
    Martin Fuchs
    2007-12-06

    • summary: use ConversationParser in rule engine --> use ConversationParser in NPC fsm engine
    • status: open --> closed-accepted
     


Anonymous


Cancel   Add attachments