branch: elpa/pacmacs
commit 151da84fdcd0ccd0e40d4f386da2cadc415cc520
Author: rexim <[email protected]>
Commit: rexim <[email protected]>
Remove replace-game-object function (#171)
---
pacmacs.el | 8 --------
test/pacmacs-test.el | 24 ------------------------
2 files changed, 32 deletions(-)
diff --git a/pacmacs.el b/pacmacs.el
index 205a0932f1..d8870b3fa9 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -430,14 +430,6 @@
(pacmacs--create-game-object row column 'pacmacs--ghosts
#'pacmacs--make-ghost))
-(defun pacmacs--replace-game-objects (game-objects new-constructor
old-destructor)
- (dolist (game-object game-objects)
- (plist-bind ((row :row)
- (column :column))
- game-object
- (funcall new-constructor row column))
- (funcall old-destructor game-object)))
-
(defun pacmacs--terrified-ghost-timed-out-p (terrified-ghost)
(<= (plist-get terrified-ghost :terrified-timer) 0))
diff --git a/test/pacmacs-test.el b/test/pacmacs-test.el
index 5c0858880b..78a5a2f81b 100644
--- a/test/pacmacs-test.el
+++ b/test/pacmacs-test.el
@@ -42,30 +42,6 @@
(should (equal expected-outcome
pacmacs--terrified-ghosts))))
-(ert-deftest pacmacs--replace-game-objects-test ()
- (let* ((game-objects '((:row 10 :column 20)
- (:row 30 :column 40)))
- (replaced-objects nil)
- (destroyed-objects nil)
- (new-constructor (-lambda (row column)
- (setq replaced-objects
- (cons (list :row (1+ row)
- :column (1+ column))
- replaced-objects))))
- (old-destructor (-lambda (game-object)
- (setq destroyed-objects (cons game-object
- destroyed-objects)))))
- (pacmacs--replace-game-objects game-objects new-constructor old-destructor)
- (should (equal '((:row 10 :column 20)
- (:row 30 :column 40))
- game-objects))
- (should (equal '((:row 31 :column 41)
- (:row 11 :column 21))
- replaced-objects))
- (should (equal '((:row 30 :column 40)
- (:row 10 :column 20))
- destroyed-objects))))
-
(ert-deftest pacmacs--handle-ghost-blinking-threshold-test ()
(let ((pacmacs--terrified-ghosts '((:terrified-timer 900 :current-animation
1)
(:terrified-timer 999 :current-animation
2)