Package net.bytten.metazelda.constraints

Examples of net.bytten.metazelda.constraints.CountConstraints


           
        }
       
        if (constraints == null) {
           
            CountConstraints cons = null;
           
            dungeonView = new GridDungeonView();
       
            if (getArg("space") != null) {
                try {
                    SpaceMap spaceMap = new SpaceMap();
                   
                    BufferedImage img = ImageIO.read(new File(getArg("space")));
                    for (int x = 0; x < img.getWidth(); ++x)
                    for (int y = 0; y < img.getHeight(); ++y) {
                        if ((img.getRGB(x,y) & 0xFFFFFF) != 0) {
                            spaceMap.set(new Coords(x,y), true);
                        }
                    }
                   
                    cons = new SpaceConstraints(spaceMap);
                   
                } catch (IOException e) {
                    e.printStackTrace();
                    System.err.println("Falling back on CountConstraints");
                }
            }
           
            if (cons == null)
                cons = new CountConstraints(25, 4, 1);
           
            if (getArg("switches") == null)
                cons.setMaxSwitches(0);
           
            constraints = cons;
        }
       
        DungeonGenerator generator;
View Full Code Here

TOP

Related Classes of net.bytten.metazelda.constraints.CountConstraints

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.