From 84b003379043d2aaea7945d32d4ac2d096b5b953 Mon Sep 17 00:00:00 2001 From: falsycat Date: Sat, 5 Oct 2019 00:00:00 +0000 Subject: [PATCH] [add] Added ElementInterface. --- sjplayer/src/sjplayer/ElementInterface.d | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sjplayer/src/sjplayer/ElementInterface.d diff --git a/sjplayer/src/sjplayer/ElementInterface.d b/sjplayer/src/sjplayer/ElementInterface.d new file mode 100644 index 0000000..5ed8a58 --- /dev/null +++ b/sjplayer/src/sjplayer/ElementInterface.d @@ -0,0 +1,26 @@ +/// License: MIT +module sjplayer.ElementInterface; + +import gl4d; + +/// +interface ElementInterface { + public: + /// + static struct DamageCalculationResult { + /// An amount of the damage. (0~1) + float damage; + /// A nearness of the point. (0~1) + float nearness; + } + + /// + DamageCalculationResult CalculateDamage(vec2 p1, vec2 p2) const; +} + +/// +interface ElementDrawerInterface { + public: + /// + void Draw(); +}