For example code see [browser:world_generator/trunk/src/test/java/edu/kit/ipd/aliceNlp/worldGeneration/ Generator Testing File]

Handling Element indices

In Alice all child elements of a node are stored in one sub-tree of it. This is a general storage place of the
child-Elements. However, in order to use or call this Elements, Alice has to keep a reference to the element
in additional Element fields, depending on the functionality of the child Element in the Alice-World. That is why
you should be aware of the multiple indices of an Element when using Generator.add():

  1. The global index: This index contains all direct child Elements of the parent Node.
    Fortunately, the Generator API manages the global index for you, so you must only keep in mind section 2:
  2. A special purpose index: This index may contain some direct children of the parent Node.
    The global index must therefore already contain the direct child-Element.
    For example:
    1. BranchType.Responses (Default index) A method call moveAnimation can be placed as a
      child of the main-routine Element. In this case the Element moveAnimation will be
      referenced in the branch componentResponses
    2. BranchType.ElseResponses/?/ If you want to populate the Else-Branch of the method, you are right
      using generator.add(Generator.BranchType?.ElseResponses?, ...);
Last modified 5 years ago Last modified on Oct 6, 2013 1:27:02 AM