package wow.doge.mygame

import org.scalatest.funsuite.AnyFunSuite
import com.jme3.scene.Spatial
import com.jme3.collision.{Collidable, CollisionResults}
import com.jme3.bounding.BoundingVolume
import com.jme3.scene.Spatial.DFSMode
import com.jme3.scene.SceneGraphVisitor
import java.util.Queue
import wow.doge.mygame.utils.wrappers.jme.CollisionShapeFactory
import monix.execution.Scheduler.Implicits.global
import cats.syntax.eq._

class CollisionShapeFactoryTest extends AnyFunSuite {
  test("Test for WrongArgumentError") {
    val res = CollisionShapeFactory
      .createMeshShape(new TestSpatial)
      .attempt
      .runSyncUnsafe()

    assert(res.isLeft)

    assert(
      res.left.get eqv
        CollisionShapeFactory.WrongArgumentError(
          "The spatial must either be a Node or a Geometry!"
        )
    )
  }
}

class TestSpatial extends Spatial {

  override def collideWith(x$1: Collidable, x$2: CollisionResults): Int = ???

  override def updateModelBound(): Unit = ???

  override def setModelBound(x$1: BoundingVolume): Unit = ???

  override def getVertexCount(): Int = ???

  override def getTriangleCount(): Int = ???

  override def depthFirstTraversal(x$1: SceneGraphVisitor, x$2: DFSMode): Unit =
    ???

  override protected def breadthFirstTraversal(
      x$1: SceneGraphVisitor,
      x$2: Queue[Spatial]
  ): Unit = ???

}
