It is always possible to do it differently, with fired event handlers for instance, but the alternative solutions are either bad, performance wise, or unintuitive and makes the code less pedagogical for someone who wants to learn by exploring the addon.
A logical and intuitive syntax would be for instance:
class MyAmmo
{
...
class ammo_eventhandlers
{
hit = "code1";
destroyed = "code2";
};
};