public void addPurchase(Purchase purchase){
        if(purchase != null){
            if(purchase.id != null){
                addTank(purchase.id, purchase.id_tank, purchase.id_armor, purchase.id_engine, purchase.id_first_weapon, purchase.id_second_weapon);
                addArmor(purchase.id_armor);
                addEngine(purchase.id_engine);
                addFirstWeapon(purchase.id_first_weapon);
                addSecondWeapon(purchase.id_second_weapon);
            }else if(purchase.id_armor != null){
                addArmor(purchase.id_armor);
            }else if(purchase.id_engine != null){
                addEngine(purchase.id_engine);
            }else if(purchase.id_first_weapon != null){
                addFirstWeapon(purchase.id_first_weapon);
            }else if(purchase.id_second_weapon != null){
                addSecondWeapon(purchase.id_second_weapon);
            }
        }
    }