summaryrefslogtreecommitdiff
path: root/chess-game.el
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2002-04-08 23:53:46 +0000
committerJohn Wiegley <johnw@newartisans.com>2002-04-08 23:53:46 +0000
commit039172c36273647bca85f156c99894c678cd6e3f (patch)
treea4128c7666e5598a357f879bc74277c93ec65010 /chess-game.el
parentcb292857fae712a8527eebfd03e3878527a462af (diff)
added `chess-game-set-start-position'
Diffstat (limited to 'chess-game.el')
-rw-r--r--chess-game.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/chess-game.el b/chess-game.el
index a446115..d1eb706 100644
--- a/chess-game.el
+++ b/chess-game.el
@@ -91,7 +91,11 @@
(defsubst chess-game-set-plies (game plies)
"Return the tags alist associated with GAME."
(setcdr (nthcdr 1 game) (list plies))
- (chess-game-run-hooks game 'set-plies))
+ (chess-game-run-hooks game 'setup (chess-ply-pos (car (last plies)))))
+
+(defsubst chess-game-set-start-position (game position)
+ "Return the tags alist associated with GAME."
+ (chess-game-set-plies game (list (chess-ply-create position))))
(defsubst chess-game-pos (game &optional index)
"Return the position related to GAME's INDEX position."
@@ -127,8 +131,9 @@
Optionally use the given starting POSITION.
TAGS is the starting set of game tags (which can always be changed
later using the various tag-related methods)."
- (let ((game (list nil tags (list (chess-ply-create (or position
- (chess-pos-create)))))))
+ (let ((game (list nil tags
+ (list (chess-ply-create (or position
+ (chess-pos-create)))))))
(dolist (tag (cons (cons "Date" (format-time-string "%Y.%m.%d"))
chess-game-default-tags))
(unless (chess-game-tag game (car tag))