add actor map constructor
This commit is contained in:
parent
886b9df439
commit
f16c4fe911
|
@ -40,3 +40,11 @@ trait ActorMap[A <: Actor] extends Actor {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
object ActorMap {
|
||||
|
||||
def apply[A <: Actor](make: String => A) = new ActorMap[A] {
|
||||
def mkActor(id: String) = make(id)
|
||||
def receive = actorMapReceive
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ final class Env(
|
|||
|
||||
lazy val history = () => new History(ttl = MessageTtl)
|
||||
|
||||
val roundMap = system.actorOf(Props(new lila.hub.ActorMap[Round] {
|
||||
def mkActor(id: String) = new Round(
|
||||
val roundMap = system.actorOf(Props(lila.hub.ActorMap { id =>
|
||||
new Round(
|
||||
gameId = id,
|
||||
messenger = messenger,
|
||||
takebacker = takebacker,
|
||||
|
@ -58,7 +58,6 @@ final class Env(
|
|||
drawer = drawer,
|
||||
socketHub = socketHub,
|
||||
moretimeDuration = Moretime)
|
||||
def receive = actorMapReceive
|
||||
}), name = ActorMapName)
|
||||
|
||||
private val socketHub = {
|
||||
|
|
Loading…
Reference in a new issue