/*
 The MIT License (MIT)

 Copyright (c) 2016 GameBoxx <http://gameboxx.info>
 Copyright (c) 2016 contributors

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:

 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */

package info.gameboxx.gameboxx.game;

/**
 * The type of arena.
 */
public enum ArenaType {
    /**
     * This arena type is linked to it's own world.
     * Each time a new {@link GameSession} is created it will create a copy of the linked template world.
     * This arena type can have multiple {@link GameSession} sessions.
     */
    WORLD,

    /**
     * This arena type doesn't have an arena/world attached to it.
     * Basically when a new {@link GameSession} is created it will generate a new world with configurable options.
     * This can be used for games like UHC and such that use a random generated vanilla world.
     */
    GENERATE_WORLD,

    /**
     * This arena type is the default and it won't have an world or anything attached.
     * It can only have ONE {@link GameSession} and by default nothing will regenerate.
     * You can attach a component to regenerate a cuboid in the arena but that's it.
     * This should used for smaller games with multiple games per world and such.
     * Just remember that there can only be one session per arena with this type.
     */
    DEFAULT;
}

@@ -1187,16 +1187,79 @@
 .game;%0A%0A
+import com.google.common.collect.Maps;%0A%0Aimport java.util.Map;%0A%0A
 /**%0A * T
@@ -1554,24 +1554,33 @@
 */%0A    WORLD
+(%22World%22)
 ,%0A%0A    /**%0A 
@@ -1881,16 +1881,34 @@
 TE_WORLD
+(%22Generate world%22)
 ,%0A%0A    /
@@ -2353,12 +2353,961 @@
  DEFAULT
-;
+(%22Default%22);%0A%0A    private String name;%0A    private final static Map%3CString, ArenaType%3E BY_NAME = Maps.newHashMap();%0A%0A    static %7B%0A        for (ArenaType type : values()) %7B%0A            BY_NAME.put(type.getName().toLowerCase().replace(%22 %22, %22%22), type);%0A            BY_NAME.put(type.toString().toLowerCase(), type);%0A        %7D%0A    %7D%0A%0A    ArenaType(String name) %7B%0A        this.name = name;%0A    %7D%0A%0A    /**%0A     * Get the name of the arena type.%0A     * @return Name of the type.%0A     */%0A    public String getName() %7B%0A        return name;%0A    %7D%0A%0A    /**%0A     * Get an %7B@link ArenaType%7D by name.%0A     * The name can be like GENERATE_WORLD or generate world.%0A     * @param name The name to get the type for.%0A     * @return The %7B@link ArenaType%7D from the specified name or %7B@code null%7D when there is no type by the specified name.%0A     */%0A    public static ArenaType fromName(String name) %7B%0A        return BY_NAME.get(name.toLowerCase().replace(%22 %22, %22%22));%0A    %7D%0A
 %0A%7D%0A

Add method to get arena type by name.