eschulte pushed a commit to branch go
in repository elpa.
commit ec341609addd29bc6ee97e347adab7bfb427973a
Author: Eric Schulte <[email protected]>
Date: Sat Aug 24 17:02:49 2013 -0600
adding `go-dead' to the API
---
back-ends/gnugo.el | 7 +++++++
back-ends/gtp.el | 3 +++
back-ends/igs.el | 3 +++
back-ends/sgf.el | 3 +++
go-api.el | 1 +
5 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/back-ends/gnugo.el b/back-ends/gnugo.el
index 7feefcc..2a60773 100644
--- a/back-ends/gnugo.el
+++ b/back-ends/gnugo.el
@@ -107,4 +107,11 @@ For example, the following changes the level of gnugo.
(defmethod set-player-name ((gnugo gnugo) color name)
(signal 'unsupported-back-end-command (list gnugo :set-player-name name)))
+(defmethod go-dead ((gnugo gnugo))
+ (mapcar (lambda (gtp-point) (gtp-to-pos nil gtp-point))
+ (mapcar #'symbol-name
+ (read (format "(%s)"
+ (gnugo-command-to-string
+ gnugo "final_status_list dead"))))))
+
(provide 'gnugo)
diff --git a/back-ends/gtp.el b/back-ends/gtp.el
index daeb3f0..7fc8f2a 100644
--- a/back-ends/gtp.el
+++ b/back-ends/gtp.el
@@ -162,4 +162,7 @@
(defmethod go-territory ((gtp gtp))
(append (gtp-territory gtp :B) (gtp-territory gtp :W)))
+(defmethod go-dead ((gtp gtp))
+ (signal 'unsupported-back-end-command (list gtp :dead)))
+
(provide 'gtp)
diff --git a/back-ends/igs.el b/back-ends/igs.el
index 88cccce..b0dca97 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -226,6 +226,9 @@ This is used to re-send messages to keep the IGS server
from timing out.")
(defmethod go-territory ((igs igs))
(signal 'unsupported-back-end-command (list igs :territory)))
+(defmethod go-dead ((igs igs))
+ (signal 'unsupported-back-end-command (list igs :dead)))
+
(defmacro igs-w-proc (proc &rest body)
(declare (indent 1))
`(with-current-buffer (process-buffer proc) ,@body))
diff --git a/back-ends/sgf.el b/back-ends/sgf.el
index 6048dc3..aa1b838 100644
--- a/back-ends/sgf.el
+++ b/back-ends/sgf.el
@@ -194,4 +194,7 @@
(defmethod go-territory ((sgf sgf))
(signal 'unsupported-back-end-command (list sgf :territory)))
+(defmethod go-dead ((sgf sgf))
+ (signal 'unsupported-back-end-command (list sgf :dead)))
+
(provide 'sgf)
diff --git a/go-api.el b/go-api.el
index 45908c4..f62af72 100644
--- a/go-api.el
+++ b/go-api.el
@@ -77,5 +77,6 @@
(defgeneric go-quit (back-end) "Quit the BACK-END.")
(defgeneric go-score (back-end) "Ask BACK-END to report the score.")
(defgeneric go-territory (back-end) "Ask BACK-END to report the territory.")
+(defgeneric go-dead (back-end) "Ask BACK-END to dead stones.")
(provide 'go-api)