package com.nestedworld.nestedworld.database.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.orm.SugarRecord;
import com.orm.dsl.Unique;

/**
 * Simple model for :
 * - mapping a json response with Gson anotation
 * - mapping a sql table with SugarORM
 * /!\ Keep the default constructor empty (see sugarOrm doc)
 */
public class Attack extends SugarRecord {

    @Expose
    @SerializedName("id")
    @Unique
    public Long attack_id;// the sql table will be called attackid (see sugarOrm doc)
    @Expose
    public String name;
    @Expose
    public String type;

    //Empty constructor for SugarRecord
    public Attack() {
        //Keep empty
    }

    //Generated
    @Override
    public String toString() {
        return "Attack{" +
                "attack_id=" + attack_id +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}

@@ -636,86 +636,770 @@
     
-//Empty constructor for SugarRecord%0A    public Attack() %7B%0A        //Keep empty
+public enum AttackType %7B%0A        ATTACK,%0A        ATTACK_SP,%0A        DEFENSE,%0A        DEFENSE_SP,%0A        OBJECT_USE,%0A        UNKNOWN%0A    %7D%0A%0A    //Empty constructor for SugarRecord%0A    public Attack() %7B%0A        //Keep empty%0A    %7D%0A%0A    public AttackType getType() %7B%0A        if (this.type != null) %7B%0A            switch (this.type) %7B%0A                case %22attack%22:%0A                    return AttackType.ATTACK;%0A                case %22attacksp%22:%0A                    return AttackType.ATTACK_SP;%0A                case %22defense%22:%0A                    return AttackType.DEFENSE;%0A                case %22defensesp%22:%0A                    return AttackType.DEFENSE_SP;%0A                default:%0A                    break;%0A            %7D%0A        %7D%0A        return AttackType.UNKNOWN;
 %0A   
@@ -1605,20 +1605,25 @@
 pe='%22 + 
-t
+getT
 ype
+()
  + '%5C'' 

enhance attack model