Пример #1
0
 @Override
 public List<StructureComponent> getNextComponents() {
   final StructureComponent component;
   final float draw = getRandom().nextFloat();
   if (draw > 0.8) {
     component = new StrongholdSpiralStaircase(parent);
   } else if (draw > 0.6) {
     component = new StrongholdPrison(parent);
   } else if (draw > 0.4) {
     component = new StrongholdIntersection(parent);
   } else if (draw > 0.2) {
     component = new StrongholdStaircase(parent);
   } else {
     component = new StrongholdChestCorridor(parent);
   }
   if (left) {
     component.setPosition(position.add(rotate(5, 0, 4)));
     component.setRotation(rotation.rotate(90, 0, 1, 0));
   } else {
     component.setPosition(position.add(rotate(-1, 0, 0)));
     component.setRotation(rotation.rotate(-90, 0, 1, 0));
   }
   component.randomize();
   return Arrays.asList(component);
 }
Пример #2
0
 @Override
 public List<StructureComponent> getNextComponents() {
   final StructureComponent component;
   final float draw = getRandom().nextFloat();
   if (draw > 0.95) {
     component = new StrongholdLibrary(parent);
     component.setPosition(position.add(rotate(-3, 0, 11)));
   } else if (draw > 0.90) {
     component = new StrongholdLargeIntersection(parent);
     component.setPosition(position.add(rotate(-3, -2, 11)));
   } else if (draw > 0.75) {
     component = new StrongholdSpiralStaircase(parent);
     component.setPosition(position.add(rotate(0, 0, 11)));
   } else if (draw > 0.60) {
     component = new StrongholdRoom(parent);
     component.setPosition(position.add(rotate(-3, 0, 11)));
   } else if (draw > 0.45) {
     component = new StrongholdChestCorridor(parent);
     component.setPosition(position.add(rotate(0, 0, 11)));
   } else if (draw > 0.30) {
     component = new StrongholdIntersection(parent);
     component.setPosition(position.add(rotate(0, 0, 11)));
   } else if (draw > 0.15) {
     component = new StrongholdStaircase(parent);
     component.setPosition(position.add(rotate(0, 0, 11)));
   } else {
     component = new StrongholdTurn(parent);
     component.setPosition(position.add(rotate(0, 0, 11)));
   }
   component.setRotation(rotation);
   component.randomize();
   return Arrays.asList(component);
 }