package com.iskrembilen.quasseldroid;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * User: Stian
 * Date: 05.07.12
 * Time: 20:14
 */
public enum IrcMode {
    OWNER ("owner","q", 1),
    ADMIN ("admin","a", 2),
    OPERATOR ("operator","o", 3),
    HALF_OPERATOR ("half operator","h", 4),
    VOICE ("voice","v", 5),
    USER ("user","u", 6);

    public final String name;
    public final String shortName;
    public final int rank;

    IrcMode(String name, String shortName, int rank) {
        this.name = name;
        this.shortName = shortName;
        this.rank = rank;
    }
}

@@ -187,16 +187,145 @@
 cMode %7B%0A
+    /*%0A     * Declare in order of rank, this way values() will naturally%0A     * return the different modes based on rank%0A     */%0A
     OWNE
@@ -342,11 +342,8 @@
 ,%22q%22
-, 1
 ),%0A 
@@ -367,11 +367,8 @@
 ,%22a%22
-, 2
 ),%0A 
@@ -398,11 +398,8 @@
 ,%22o%22
-, 3
 ),%0A 
@@ -439,11 +439,8 @@
 ,%22h%22
-, 4
 ),%0A 
@@ -464,11 +464,8 @@
 ,%22v%22
-, 5
 ),%0A 
@@ -485,46 +485,62 @@
 r%22,%22
-u%22, 6);%0A%0A    public final String name;
+%22); //This will work as a catch-all for unknown modes%0A
 %0A   
@@ -556,29 +556,28 @@
 inal String 
-short
+mode
 Name;%0A    pu
@@ -587,24 +587,36 @@
 c final 
-int rank
+String shortModeName
 ;%0A%0A    I
@@ -629,17 +629,21 @@
 (String 
-n
+modeN
 ame, Str
@@ -655,22 +655,16 @@
 hort
+Mode
 Name
-, int rank
 ) %7B%0A
@@ -680,16 +680,24 @@
 his.
-n
+modeN
 ame = 
-n
+modeN
 ame;
@@ -711,24 +711,28 @@
   this.short
+Mode
 Name = short
@@ -731,16 +731,20 @@
  = short
+Mode
 Name;%0A  
@@ -749,34 +749,9 @@
     
-    this.rank = rank;%0A    
 %7D
+%0A
 %0A%7D%0A

Remove rank from IrcMode