View Javadoc

1   /*
2    * To change this template, choose Tools | Templates
3    * and open the template in the editor.
4    */
5   
6   package cz.cuni.amis.pogamut.udk.t3dgenerator;
7   
8   import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.AbstractActor;
9   import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.map.Level;
10  import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.map.MapElement;
11  import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.map.MapPackage;
12  import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.map.Surface;
13  import cz.cuni.amis.pogamut.udk.t3dgenerator.elements.map.TopLevelPackage;
14  import java.util.List;
15  
16  /**
17   * Helper utils  for creating T3D.
18   * @author Martin Cerny
19   */
20  public class T3dElementHelper {
21  
22      /**
23       * Wraps a list of actors into a map, so that it can be seamlessly imported into UDK editor.
24       * @param mapName
25       * @param actors
26       * @return 
27       */
28      public static MapElement wrapActorsIntoMap(String mapName,  List<? extends AbstractActor> actors){
29          return wrapActorsIntoMap(mapName, actors, null);
30      }
31  
32      /**
33       * 
34       * @param mapName
35       * @param actors
36       * @param killZ currently ignored, since there are some trouble with importing the WorldInfo object
37       * @return 
38       */ 
39      public static MapElement wrapActorsIntoMap(String mapName,  List<? extends AbstractActor> actors, Float killZ){
40          return new MapElement(mapName, new MapPackage(new TopLevelPackage(mapName)), new Level(actors), new Surface());
41      }
42  }