////////////////////////////////////////
// Programming project code
// UniBw M, 2022, 2023, 2024
// www.unibw.de/inf2
// (c) Mark Minas (mark.minas@unibw.de)
////////////////////////////////////////

package pp.battleship;

import java.util.ResourceBundle;

/**
 * Provides access to the resource bundle of the game.
 *
 * @see #BUNDLE
 */
public class Resources {
    /**
     * The resource bundle for the Battleship game.
     */
    public static final ResourceBundle BUNDLE = ResourceBundle.getBundle("battleship"); //NON-NLS

    /**
     * Gets a string for the given key from the resource bundle in {@linkplain #BUNDLE}.
     *
     * @param key the key for the desired string
     * @return the string for the given key
     * @throws NullPointerException               if {@code key} is {@code null}
     * @throws java.util.MissingResourceException if no object for the given key can be found
     * @throws ClassCastException                 if the object found for the given key is not a string
     */
    public static String lookup(String key) {
        return BUNDLE.getString(key);
    }

    /**
     * Private constructor to prevent instantiation.
     */
    private Resources() { /* do not instantiate */ }
}
