ID:2403072
 
Redundant
Applies to:DM Language
Status: Redundant

This feature has already been implemented, or is already achievable with existing methods.
New procs, called to the atom on Cross(atom/A) and Bump(atom/A), respectively.
Isn't HasCrossed() just... the Crossed() function?

I would appreciate a built-in Bumped(), but IIRC this is something that can be done in softcode.
On the subject of new hooks, I'd really prefer built-in reciprocals to Cross(), Uncross(), Crossed() and Uncrossed(), because proper encapsulation of code is important and DM makes this relationship rather one-sided.

A crosses B, A is notified, but B never knows unless you set up your own hooks.

Unfortunately, overriding A.cross later on means that your own hook will never be called, so you can effectively break this behavior and it's unreliable.

The only way to get around this is to declare this behavior at the end of the root project's DMB file so that it's the last thing to compile, which can't be done from a library unless you force the library to be compiled at the end of the root project's DMB file, which is a brittle implementation in the first place.

Even then, it won't work for subclasses, because your library would have to be aware of the entire hierarchy ahead of time to automatically account for overrides.
In response to Pokemonred200
Nope, it isn't. Cross() is called at the src when an atom is trying to overlap it. Crossed() is called at the src when an atom succesfully overlapped it.

What I want is for Cross and Bump to call new procs at the atom that crossed/bumped src (HasCrossed and HasBumped but it can be any other name, lol).
Bump
Bumping.
Here it is, as simple as it can be. These will work as long as you call ..() in overrides (if any) of Crossed, Uncrossed, and Bump (which was always best practice anyways).
atom
// mover crossed src
Crossed(atom/movable/mover)
..()
mover.CrossedOther(src)

// mover uncrossed src
Uncrossed(atom/movable/mover)
..()
mover.UncrossedOther(src)

proc
// mover bumped src
BumpedBy(atom/movable/mover)

atom/movable
// src bumped other
Bump(atom/other)
..()
other.BumpedBy(src)

proc
// src crossed other
CrossedOther(atom/other)

// src uncrossed other
UncrossedOther(atom/other)
In response to Kaiochao
Thank you!
Nadrew resolved issue (Redundant)