scala - Two dimensional arrays of type actors -
i new scala , trying implement system of multiple actors of same type. using akka actors same. want keep these actors in 2 dimensional array not able initialize 2d array. below actor initialization.
var fighter1 : actorref = system.actorof(props[fighter],name = "fighter1") //2d array of type actor(fighter) var locationmatrix= array.ofdim[fighter](3,3) //initialization locationmatrix(0)(1)=fighter1 //this throws error
fighter1 of type actorref , locationmatrix holds fighter objects therefore cannot put fighter1 inside it.
try this:
var locationmatrix = array.ofdim[actorref](3,3)
Comments
Post a Comment