public void setNewType(int type)
    {
        switch(type)
        {
            case UNIT_TYPE_SWORDMAN: setSword();
                 break;
            case UNIT_TYPE_SPEARMAN: setSpear();
                 break;
            case UNIT_TYPE_ARCHER: setArcher();
                 break;
            case UNIT_TYPE_CAVALRY: setCavalry();
                 break;
            case UNIT_TYPE_LONGSWORD: setLongSword();
                 break;
            case UNIT_TYPE_HALBERD: setHalberd();
                 break;
        }
    }