make library filenames customizable
[lifp.git] / iflib.lisp
index e9145fb1f725180bb27cc9573bfbfa2b94f81aa0..0684f32c18e601843949eae2649459ac8d84539c 100644 (file)
 \r
 (declare-predicate add-to-scope add-to-outscope found-in seen-from)\r
 \r
+\r
+;;Library file names\r
+(defvar *library-file-if* "if.fas")\r
+(defvar *library-file-iflib* "if.fas")\r
+(defvar *library-file-verbs* "if.fas") \r
+\r
 ;;SECTION 2: Library-defined classes and objects\r
 \r
 (ifclass container () (capacity integer) (has :container))\r
 (defun lib (file dir)\r
   "Reloads the IF library" \r
   (format t "[DIRECTORY: ~a]~%" dir)\r
-  (print-message "Loading if.fas...")\r
-  (load (merge-pathnames dir "if.fas"))\r
-  (print-message "Loading iflib.fas...") \r
-  (load (merge-pathnames dir "iflib.fas"))\r
-  (print-message "Loading verbs.fas...") \r
-  (load (merge-pathnames dir "verbs.fas"))\r
+  (print-message "Loading if-basic-lib...")\r
+  (load (merge-pathnames dir *library-file-if*))\r
+  (print-message "Loading if-lib...") \r
+  (load (merge-pathnames dir *library-file-iflib*))\r
+  (print-message "Loading verbs...") \r
+  (load (merge-pathnames dir *library-file-verbs*))\r
   (print-message "Loading game module...") \r
   (load file)\r
   (print-message "Module is successfully loaded."))\r
 \r
-(defun test-seq (&optional (rm nil))\r
+(defun test-seq (&optional (rm *repl-mode*))\r
   "Test sequence emulating interactive fiction interpreter"\r
-  (load-cfg "iflib.cfg")\r
+  ;;(load-cfg "iflib.cfg")\r
   (setf *score* 0 \r
        *turns* 0\r
        *gamestate* 0)\r
 (defun interactive-start ()\r
   "Function intended to be used by user"\r
   (load-cfg "iflib.cfg")\r
-  (run-console #'seq #'lib :interactive t)\r
-  (when *hard-quit* (quit-lisp)))\r
+  (unless *repl-mode*\r
+    (run-console #'seq #'lib :interactive t)\r
+    (when *hard-quit* (quit-lisp))))\r
 \r
 ;;SECTION 9: Other stuff\r
 \r
   `(defpackage ,name\r
     (:use :common-lisp :if-basic-lib :if-lib :verb-lib ,@other-packages)\r
     (:shadowing-import-from :if-lib :room)\r
-    (:shadowing-import-from :verb-lib :listen)))\r
+    (:shadowing-import-from :verb-lib :listen :fill)))\r
 \r
 (defmacro free-symbol (id)\r
   "Frees a symbol from current package using shadow"\r