package anabalica.github.io.meowletters.letters;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * Alphabet class stores all the alphabets that can be used in the game. It
 * contains constants with alphabet strings and the currently active alphabet.
 *
 * @author Ana Balica
 */
public class Alphabet {
    // Game alphabets
    public static final String ENGLISH = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    public static final String ROMANIAN = "AĂÂBCDEFGHIÎJKLMNOPQRSŞTŢUVWXYZ";

    // All available alphabets
    private static ArrayList<String> alphabets = new ArrayList<String>(
            Arrays.asList(ENGLISH, ROMANIAN));

    // Currently active/enabled alphabet
    private static String CURRENT = ENGLISH;


    /**
     * Get currently active/enabled alphabet
     *
     * @return alphabet
     */
    public static String getCurrent() {
        return CURRENT;
    }

    /**
     * Set the currently active alphabet. There can be only one alphabet in use.
     * If you want to add a new alphabet to the game, don't forget to add it to
     * the Alphabet.alphabets list.
     *
     * @param alphabet valid language alphabet
     */
    public static void setCurrent(String alphabet) {
        if (!alphabets.contains(alphabet)) {
            throw new IllegalArgumentException("Illegal alphabet");
        }
        CURRENT = alphabet;
    }
}

@@ -64,42 +64,15 @@
 til.
-ArrayList;%0Aimport java.util.Arrays
+HashMap
 ;%0A%0A/
@@ -507,107 +507,192 @@
 tic 
-ArrayList%3CString%3E alphabets = new ArrayList%3CString%3E(%0A            Arrays.asLis
+final HashMap%3CString, String%3E alphabets;%0A    static %7B%0A        alphabets = new HashMap%3C%3E();%0A        alphabets.pu
 t(
+%22
 ENGLISH
+%22
 , 
-ROMANIAN));
+ENGLISH);%0A        alphabets.put(%22ROMANIAN%22, ROMANIAN);%0A    %7D
 %0A%0A  
@@ -776,17 +776,16 @@
 GLISH;%0A%0A
-%0A
     /**%0A
@@ -1177,23 +1177,19 @@
 abet
- valid language
+Name String
  alp
@@ -1185,32 +1185,37 @@
  String alphabet
+ name
 %0A     */%0A    pub
@@ -1256,16 +1256,20 @@
 alphabet
+Name
 ) %7B%0A    
@@ -1295,16 +1295,19 @@
 contains
+Key
 (alphabe
@@ -1307,16 +1307,20 @@
 alphabet
+Name
 )) %7B%0A   
@@ -1380,16 +1380,21 @@
 alphabet
+ name
 %22);%0A    
@@ -1425,16 +1425,35 @@
 alphabet
+s.get(alphabetName)
 ;%0A    %7D%0A

change Alphabet.setCurrent()