Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. package wow.doge.mygame
  2. import org.scalatest.funsuite.AnyFunSuite
  3. import com.jme3.scene.Spatial
  4. import com.jme3.collision.{Collidable, CollisionResults}
  5. import com.jme3.bounding.BoundingVolume
  6. import com.jme3.scene.Spatial.DFSMode
  7. import com.jme3.scene.SceneGraphVisitor
  8. import java.util.Queue
  9. import wow.doge.mygame.utils.wrappers.jme.CollisionShapeFactory
  10. import monix.execution.Scheduler.Implicits.global
  11. import cats.syntax.eq._
  12. class CollisionShapeFactoryTest extends AnyFunSuite {
  13. test("Test for WrongArgumentError") {
  14. val res = CollisionShapeFactory
  15. .createMeshShape(new TestSpatial)
  16. .attempt
  17. .runSyncUnsafe()
  18. assert(res.isLeft)
  19. assert(
  20. res.left.get eqv
  21. CollisionShapeFactory.WrongArgumentError(
  22. "The spatial must either be a Node or a Geometry!"
  23. )
  24. )
  25. }
  26. }
  27. class TestSpatial extends Spatial {
  28. override def collideWith(x$1: Collidable, x$2: CollisionResults): Int = ???
  29. override def updateModelBound(): Unit = ???
  30. override def setModelBound(x$1: BoundingVolume): Unit = ???
  31. override def getVertexCount(): Int = ???
  32. override def getTriangleCount(): Int = ???
  33. override def depthFirstTraversal(x$1: SceneGraphVisitor, x$2: DFSMode): Unit =
  34. ???
  35. override protected def breadthFirstTraversal(
  36. x$1: SceneGraphVisitor,
  37. x$2: Queue[Spatial]
  38. ): Unit = ???
  39. }