Not logged inOpenClonk Forum
Up Topic Function pointers

This board is threaded (i.e. has a tree structure). Please use the Reply button of the specific post you are referring to, not just any random button. If you want to reply to the topic in general, use the Post button near the top and bottom of the page.

Post Reply
In Response to Sven2
Both #appendto and Effects are kinda awkward, but their functionality is definitely required and useful. It would be great if we had better mechanisms for that. For instance, instead of an #appendto to the rock script to overload the Hit callback, it could be possible to write Rock->Hit = MyHitImplementation.

We would have to think of a method to call the previously overloaded function though. The overloaded function is often integrated into the logic of the overloader, for example as in

func MaxContents() { if (foo) return inherited()*2 else return inherited(); }.

So I don't think it's sufficient to just collect the functions as in Rock->Hit = [Rock->Hit, MyHitImplementation].

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill