summaryrefslogtreecommitdiff
path: root/chess-none.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-12 01:17:38 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-12 01:17:38 +0000
commitcdba8a5aed3bd66e62f348a7064acece342bb68e (patch)
tree286d53818453b1872483a1c73fface221e87eb3a /chess-none.el
parentefeb1b7a6e0caea5d1722cce7a6414190cdeae06 (diff)
*** no comment ***
Diffstat (limited to 'chess-none.el')
-rw-r--r--chess-none.el28
1 files changed, 28 insertions, 0 deletions
diff --git a/chess-none.el b/chess-none.el
new file mode 100644
index 0000000..d916adf
--- /dev/null
+++ b/chess-none.el
@@ -0,0 +1,28 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; A null engine, used when two humans play each on the same display.
+;;
+;; $Revision$
+
+(require 'chess-engine)
+
+(defun chess-none-handler (event &rest args)
+ "Initialize the network chess engine."
+ (cond
+ ((eq event 'send))
+
+ ((eq event 'ready)
+ (and (chess-engine-game nil)
+ (chess-game-set-data (chess-engine-game nil) 'active t)))
+
+ ((memq event '(resign abort))
+ (and (chess-engine-game nil)
+ (chess-engine-set-start-position nil)))
+
+ ((eq event 'undo)
+ (if (chess-engine-game nil)
+ (chess-game-undo (chess-engine-game nil) (car args))))))
+
+(provide 'chess-none)
+
+;;; chess-none.el ends here