Guest User

Ma class

a guest
May 19th, 2012
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1.     public static class Area
  2.     {
  3.         private int _id;
  4.         private SuperArea _superArea;
  5.         private String _name;
  6.         private ArrayList<SubArea> _subAreas = new ArrayList<SubArea>();
  7.         private final int[] cemetery;
  8.        
  9.         public Area(int id, int superArea,String name, String cemetery)
  10.         {
  11.             _id = id;
  12.             _name = name;
  13.             _superArea = World.getSuperArea(superArea);
  14.             //this.cemetery;
  15.             _cemetery = cemetery;
  16.             //Si le continent n'est pas encore créer, on le créer et on l'ajoute au monde
  17.             if(_superArea == null)
  18.             {
  19.                 _superArea = new SuperArea(superArea);
  20.                 World.addSuperArea(_superArea);
  21.             }
  22.             cemetery = new int[]{Integer.parseInt(cemetery.split(";")[0],Integer.parseInt(cemetery.split(";")[1])
  23.         }
  24.                
  25.         public int[] getCemetery()
  26.         {
  27.             return cemetery;
  28.         }
  29.            
  30.         public String get_name()
  31.         {
  32.             return _name;
  33.         }
  34.         public int get_id()
  35.         {
  36.             return _id;
  37.         }
  38.        
  39.         public SuperArea get_superArea()
  40.         {
  41.             return _superArea;
  42.         }
  43.        
  44.         public void addSubArea(SubArea sa)
  45.         {
  46.             _subAreas.add(sa);
  47.         }
  48.        
  49.         public ArrayList<Carte> getMaps()
  50.         {
  51.             ArrayList<Carte> maps = new ArrayList<Carte>();
  52.             for(SubArea SA : _subAreas)maps.addAll(SA.getMaps());
  53.             return maps;
  54.         }
  55.     }
Advertisement
Add Comment
Please, Sign In to add comment