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.

33 lines
956 B

  1. package wow.doge.mygame.game.subsystems.ai
  2. import com.badlogic.gdx.ai.pfa.Connection
  3. import wow.doge.mygame.game.subsystems.ai.gdx.MyIndexedGraph
  4. import scala.collection.immutable.ArraySeq
  5. // import com.badlogic.gdx.ai.pfa.indexed.IndexedGraph
  6. // import scala.jdk.javaapi.CollectionConverters._
  7. case class City(x: Float, y: Float, name: String, index: Int)
  8. case class Street(fromNode: City, toNode: City, cost: Float)
  9. extends Connection[City] {
  10. override def getCost(): Float = cost
  11. override def getFromNode(): City = fromNode
  12. override def getToNode(): City = toNode
  13. }
  14. class CityGraph extends MyIndexedGraph[City] {
  15. override def getConnections(
  16. city: City
  17. ): IndexedSeq[Connection[City]] =
  18. ArraySeq(Street(City(0f, 0f, "egw", 0), City(0f, 0f, "egw", 0), 1))
  19. // or Vector(Street(City(0f, 0f, "egw", 0), City(0f, 0f, "egw", 0), 1))
  20. override def getIndex(city: City): Int = ???
  21. override def getNodeCount(): Int = ???
  22. }