print ai moves
This commit is contained in:
parent
0a7d545d9b
commit
eb6befa4a5
|
@ -40,8 +40,8 @@ final class ActorFSM(
|
|||
}
|
||||
when(IsReady) {
|
||||
case Event(Out("readyok"), doing: Doing) ⇒ {
|
||||
val lines = config go doing.current
|
||||
lines.lastOption foreach display(doing.name)
|
||||
val lines = config go doing.current
|
||||
print(doing.fold(_ ⇒ "a", _ ⇒ "."))
|
||||
lines foreach process.write
|
||||
goto(Running)
|
||||
}
|
||||
|
@ -89,10 +89,6 @@ final class ActorFSM(
|
|||
doing ⇒ stay using doing
|
||||
)
|
||||
|
||||
private def display(name: String)(msg: String) {
|
||||
loginfo("[%s] %s".format(name, msg))
|
||||
}
|
||||
|
||||
override def postStop() {
|
||||
process.destroy()
|
||||
process = null
|
||||
|
|
|
@ -37,7 +37,6 @@ object model {
|
|||
def fold[A](todo: Todo ⇒ A, doing: Doing ⇒ A): A = doing(this)
|
||||
def enqueue(task: Task) = copy(queue = queue :+ task)
|
||||
def map(f: Task ⇒ Task): Doing = copy(current = f(current))
|
||||
def name = current.fold(_ ⇒ "SFP", _ ⇒ "SFA")
|
||||
}
|
||||
|
||||
object play {
|
||||
|
|
Loading…
Reference in a new issue