SpacemanDMM icon indicating copy to clipboard operation
SpacemanDMM copied to clipboard

Feature Request: SHOULD_OVERRIDE / VIRTUAL

Open FluffyGhoster opened this issue 2 years ago • 1 comments

Basically, it would be cool to have a way to flag certain procs / variables so that you indicate that they must be overridden in derivate paths, eg:

/datum/food
    virtual var/taste = null

/datum/food/proc/effect()
    virtual

/datum/food/soup    <-- This should throw an error like "Not implementing proc: 'effect' "
    taste = "Sour"

/datum/food/spicynoodles    <-- This should throw an error like "Not implementing variable: 'taste' "

/datum/food/spicynoodles/effect()
    set_on_fire(usr)

FluffyGhoster avatar Aug 09 '23 17:08 FluffyGhoster

Abstract might be better than virtual given other language's use of the words

Andrew-Fall avatar Oct 11 '23 20:10 Andrew-Fall