Created
November 15, 2019 21:31
-
-
Save jamesmcm/2636b62715606b07ad2cf5cf85074020 to your computer and use it in GitHub Desktop.
abstract_type.scala
This file contains hidden or 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
| abstract class SpaceObject() { | |
| type T <: SpaceObject | |
| def ===(that: T): Boolean | |
| } | |
| class Sphere(val transform: Matrix, val material: Material) extends SpaceObject { | |
| type T = Sphere | |
| final def ===(that: Sphere): Boolean = { | |
| transform === that.transform && material === that.material | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment