1 package cz.cuni.amis.pogamut.usar2004.agent.module.datatypes;
2
3 import cz.cuni.amis.pogamut.usar2004.agent.module.geometry.*;
4
5
6
7
8
9
10
11
12 public enum GeometryType
13 {
14 GROUND_VEHICLE(GeoGround.class, "GroundVehicle"),
15 LEGGED_ROBOT(GeoLegged.class, "LeggedRobot"),
16 NAUTIC_VEHICLE(GeoNautic.class, "NauticVehicle"),
17 AERIAL_VEHICLE(GeoAerial.class, "AerialVehicle"),
18 SENSOR_EFFECTER(GeoSensorEffecter.class, "Sensor", "Effecter"),
19 MISSION_PACKAGE(GeoMissionPackage.class, "MisPkg");
20 private String[] kinds;
21 private Class clazz;
22
23
24
25
26
27
28 GeometryType(Class clazz, String... kinds)
29 {
30 this.kinds = kinds;
31 this.clazz = clazz;
32 }
33
34
35
36
37
38
39
40
41
42 public static GeometryType getType(String type)
43 {
44 for(GeometryType geoType : GeometryType.values())
45 {
46 for(String kind : geoType.kinds)
47 {
48 if(kind.equalsIgnoreCase(type))
49 {
50 return geoType;
51 }
52 }
53 }
54 return SENSOR_EFFECTER;
55 }
56
57
58
59
60
61
62 public Class getModuleClass()
63 {
64 return this.clazz;
65 }
66 }