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
33 lines
956 B
package wow.doge.mygame.game.subsystems.ai
|
|
|
|
import com.badlogic.gdx.ai.pfa.Connection
|
|
import wow.doge.mygame.game.subsystems.ai.gdx.MyIndexedGraph
|
|
import scala.collection.immutable.ArraySeq
|
|
// import com.badlogic.gdx.ai.pfa.indexed.IndexedGraph
|
|
// import scala.jdk.javaapi.CollectionConverters._
|
|
|
|
case class City(x: Float, y: Float, name: String, index: Int)
|
|
case class Street(fromNode: City, toNode: City, cost: Float)
|
|
extends Connection[City] {
|
|
|
|
override def getCost(): Float = cost
|
|
|
|
override def getFromNode(): City = fromNode
|
|
|
|
override def getToNode(): City = toNode
|
|
|
|
}
|
|
|
|
class CityGraph extends MyIndexedGraph[City] {
|
|
|
|
override def getConnections(
|
|
city: City
|
|
): IndexedSeq[Connection[City]] =
|
|
ArraySeq(Street(City(0f, 0f, "egw", 0), City(0f, 0f, "egw", 0), 1))
|
|
// or Vector(Street(City(0f, 0f, "egw", 0), City(0f, 0f, "egw", 0), 1))
|
|
|
|
override def getIndex(city: City): Int = ???
|
|
|
|
override def getNodeCount(): Int = ???
|
|
|
|
}
|