@Override
    public void actionPerformed(ActionEvent e) {
        if (x == load_x && y > a.ir.y && y < a.ir.y + 170) { // loading gold, right island
            if (currentgold + 5 <= maxcapacity && a.ir.goldcount > 0) {
                currentgold += 5;
                a.ir.goldcount -= 5;
            }
        } else if (x == unload_x && y > a.il.y && y < a.il.y + 170) { // unloading gold, left island
            if (currentgold - 5 >= 0) {
                currentgold -= 5;
                a.il.goldcount += 5;
            }
        }
    }