Package net.bytten.metazelda.util

Examples of net.bytten.metazelda.util.GenerationFailureException


    }
   
    protected void checkConnected() {
        if (!isConnected()) {
            // Parts of the map are unreachable!
            throw new GenerationFailureException("ColorMap is not fully connected");
        }
    }
View Full Code Here


    }
   
    public void checkConnected() {
        if (!isConnected()) {
            // Parts of the map are unreachable!
            throw new GenerationFailureException("ColorMap is not fully connected");
        }
    }
View Full Code Here

            if (dungeon.get(choice.second) == null)
                return choice.second;
            neighbors.remove(choice);
        }
        assert false;
        throw new GenerationFailureException("Internal error: Room doesn't have a free edge");
    }
View Full Code Here

                        roomsPerLock = roomsPerLock * constraints.getMaxKeys() /
                                (constraints.getMaxKeys() + 1);
                        log("roomsPerLock is now "+roomsPerLock);
                       
                        if (roomsPerLock == 0) {
                            throw new GenerationFailureException(
                                    "Failed to place rooms. Have you forgotten to disable boss-locking?");
                            // If the boss room is locked, the final key is used
                            // only for the boss room. So if the final key is
                            // also used to cross the river, rooms cannot be
                            // placed.
                        }
                    }
                }
               
                // Place the boss and goal rooms:
                placeBossGoalRooms(levels);
               
                // Place switches and the locks that require it:
                placeSwitches();
       
                // Make the dungeon less tree-like:
                graphify();
               
                computeIntensity(levels);
               
                // Place the keys within the dungeon:
                placeKeys(levels);
               
                if (levels.keyCount()-1 != constraints.getMaxKeys())
                    throw new RetryException();

                checkAcceptable();
               
                return;
           
            } catch (RetryException e) {
                if (++ attempt > MAX_RETRIES) {
                    throw new GenerationFailureException("Dungeon generator failed", e);
                }
                log("Retrying dungeon generation...");
            }
        }
       
View Full Code Here

TOP

Related Classes of net.bytten.metazelda.util.GenerationFailureException

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.