Created
October 22, 2023 17:44
-
-
Save LionGet/8a015d12ee3ba9e6f04631ed3be28957 to your computer and use it in GitHub Desktop.
Creature class with attack interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
creature:=class<abstract>: | |
Stats:stats | |
Attack:attack | |
stats:=class: | |
Health:float | |
Shield:float | |
attack:=interface(): | |
Attack():void | |
attack_melee:=class(attack): | |
Attack<override>():void= | |
Print("Melee Attack") | |
attack_ranged:=class(attack): | |
Attack<override>():void= | |
Print("Ranged Attack") | |
zergling:=class(creature): | |
Attack<override>:attack_melee | |
hydralisk:=class(creature): | |
Attack<override>:attack_ranged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment