package jesse.keeblarcraft.ChatStuff;

public class ChatFormatting {
    // These are for Minecraft chat box
    public static String COLOR_START = "§";
    public static String COLOR_END = "§f";
    public static enum COLOR_CODE {
        BLUE,
        GRAY,
        GOLD,
        RED,
        GREEN
    }

    /////////////////////////////////////////////////////////////////////////////
    /// @fn         getColor
    ///
    /// @param[in]  code is the color code that is desired
    ///
    /// @brief      Returns the MINECRAFT color code in string form to help build
    ///             colored messages for players
    ///
    /// @return     String representation of color code
    /////////////////////////////////////////////////////////////////////////////
    public static String GetColor(COLOR_CODE code) {
        String colorStr = COLOR_START;
        switch(code) {
            case BLUE:
                return colorStr + "9";
            case GRAY:
                return colorStr + "7";
            case GOLD:
                return colorStr + "6";
            case RED:
                return colorStr + "4";
            case GREEN:
                return colorStr + "2";
        }

        // If this code is reachable, then someone has not properly handled the above switch-case
        return colorStr;
    }
}
