public TrinketTool() { super(ADD_REMOVE_OP, MOVE_ROTATE_OP); List<String> builderIDs = new ArrayList<>(); for (TrinketBuilder b : BuilderManager.getAllEditableTrinketBuilders()) { builderIDs.add(b.getId()); } set = new AssetSet(builderIDs, false); }
private static void finalizeMapOn(Battlefield b) { Map m = b.getMap(); m.setStyle(BuilderManager.getMapStyleBuilder(m.getMapStyleID()).build()); TileArtisanUtil.finalizeTilesOn(m); TileArtisanUtil.readElevation(m.getAll()); m.setParcelling(new Parcelling(m)); attachInitialTrinkets(m); for (Ramp r : m.getRamps()) { r.connect(m); } AtlasArtisanUtil.buildAtlas(m); }
private void add() { Point2D coord = pencil.getCoord(); for (Trinket t : ModelManager.getBattlefield().getMap().get(coord).getData(Trinket.class)) { if (t.pos.equals(coord)) { coord = coord.getTranslation(RandomUtil.between(AngleUtil.FLAT, -AngleUtil.FLAT), 0.1); } } Trinket t = BuilderManager.getAllEditableTrinketBuilders() .get(set.actual) .build(coord.get3D(ModelManager.getBattlefield().getMap().getAltitudeAt(coord))); MapArtisanUtil.attachTrinket(t, ModelManager.getBattlefield().getMap()); t.drawOnBattlefield(); }
private static void createMapOn(Battlefield b) { Map m = new Map(BuilderManager.getMapStyleBuilder("StdMapStyle").build()); AtlasArtisanUtil.buildAtlas(m); b.setMap(m); }