From d0cb62132064b46b8a4869560a6210643b57fed4 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Wed, 28 Jun 2023 10:15:23 -0500 Subject: [PATCH] Split package definitions into packages.lisp --- .gitignore | 1 + dialogue.lisp | 12 ----- display.lisp | 6 --- engine.lisp | 6 --- flora-search-aurora.asd | 3 +- flora-search-aurora.lisp | 10 +--- input.lisp | 11 ----- inventory.lisp | 6 --- overworld.lisp | 19 -------- overworld.util.lisp | 10 ---- packages.lisp | 99 ++++++++++++++++++++++++++++++++++++++++ res/maps/tmxβ†’lisp.lisp | 8 ++-- ui.lisp | 7 --- util.lisp | 13 +----- 14 files changed, 108 insertions(+), 103 deletions(-) create mode 100644 packages.lisp diff --git a/.gitignore b/.gitignore index 1dc0808..f0902fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +res/maps/flashback-school.tmx.lisp res/maps/casino.tmx.lisp res/maps/outdoors.tmx.lisp diff --git a/dialogue.lisp b/dialogue.lisp index 5084917..c8f9b1b 100644 --- a/dialogue.lisp +++ b/dialogue.lisp @@ -16,20 +16,8 @@ ;;;; FLORA-SEARCH-AURORA.DIALOGUE ;;;; The dialogue-scripting part of the game. This handles all dialogue! -(defpackage :flora-search-aurora - (:nicknames :fsa :✿) - (:export :player)) - -(defpackage :flora-search-aurora.dialogue - (:nicknames :fsa.dia :dialogue :πŸ’¬) - (:use :cl) - (:export #:dialogue-state #:make-dialogue-state - #:start-dialogue #:face #:say #:mumble #:move - :normal-face :talking-face)) - (in-package :flora-search-aurora.dialogue) - ;;; β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” ;;; Misc. utilities diff --git a/display.lisp b/display.lisp index 7e18433..fa302b9 100644 --- a/display.lisp +++ b/display.lisp @@ -16,12 +16,6 @@ ;;;; FLORA-SEARCH-AURORA.DISPLAY ;;;; All display-related curses go here. -(defpackage :flora-search-aurora.display - (:nicknames :fsa.d :display :✎) - (:use :cl) - (:export #:make-screen-matrix #:print-screen-matrix #:matrix-delta - #:hide-cursor #:show-cursor #:clear-screen)) - (in-package :flora-search-aurora.display) diff --git a/engine.lisp b/engine.lisp index 653d755..b54f121 100644 --- a/engine.lisp +++ b/engine.lisp @@ -17,12 +17,6 @@ ;;;; The core of the game’s engine, the loop. Not much to see here other ;;;; than a loop. Honest! - -(defpackage :flora-search-aurora.engine - (:nicknames :fsa.eng :engine :βš™) - (:export #:state-loop #:main) - (:use :cl)) - (in-package :flora-search-aurora.engine) diff --git a/flora-search-aurora.asd b/flora-search-aurora.asd index 28c197a..61f052a 100644 --- a/flora-search-aurora.asd +++ b/flora-search-aurora.asd @@ -3,7 +3,8 @@ :build-operation "program-op" :build-pathname "flora-search-aurora" :entry-point "flora-search-aurora:main" - :components ((:file "util") + :components ((:file "packages") + (:file "util") (:file "display") (:file "input") (:file "ui") diff --git a/flora-search-aurora.lisp b/flora-search-aurora.lisp index 90f325b..839f3fc 100644 --- a/flora-search-aurora.lisp +++ b/flora-search-aurora.lisp @@ -17,14 +17,6 @@ ;;;; A simple TUI-game made for the text-flavoured LibreJam of 2023-06! ;;;; See: https://jamgaroo.xyz/jams/2 -(defpackage :flora-search-aurora - (:nicknames :fsa :✿) - (:export #:main) - (:use :cl - :flora-search-aurora.input :flora-search-aurora.display - :flora-search-aurora.overworld :flora-search-aurora.dialogue - :flora-search-aurora.ui)) - (in-package :flora-search-aurora) (defvar *casino-map* nil) @@ -468,7 +460,7 @@ avoid triggering this." ;;; β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” -;;; Invocation station! πŸš† +;;; Invocation station! Choo-choo! πŸš† ;;; β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€” (defun main () "A pathetic fascimile of a main loop. What does it do? WHAST DOES TI DODOO? diff --git a/input.lisp b/input.lisp index fc766a4..1abe83b 100644 --- a/input.lisp +++ b/input.lisp @@ -16,17 +16,6 @@ ;;;; FLORA-SEARCH-AURORA.INPUT ;;;; All input-related voodoo goes here: Input reading, translating, parsing, etc. -(defpackage :flora-search-aurora.input - (:use :cl) - (:nicknames :fsa.i :input :⌨) - (:export #:read-char-plist #:read-gamefied-char-plist - #:normalize-char-plist #:gameify-char-plist - #:plist-char-p - :control :meta :shift - +qwerty-layout+ +dvorak-layout+ - +arrows-game-layout+ +wasd-game-layout+ +ijkl-game-layout+ - :↑ :← :β†’ :↓ :πŸ†— :❎)) - (in-package :flora-search-aurora.input) ;; Yup, they're hardcoded like this. Horrid, ain't it? ^_^ diff --git a/inventory.lisp b/inventory.lisp index 66cc70a..b720388 100644 --- a/inventory.lisp +++ b/inventory.lisp @@ -1,4 +1,3 @@ - ;;;; Copyright Β© 2023, Jaidyn Ann ;;;; ;;;; This program is free software: you can redistribute it and/or @@ -17,11 +16,6 @@ ;;;; FLORA-SEARCH-AURORA.INVENTORY ;;;; The menu for inventory selection/management. -(defpackage :flora-search-aurora.inventory - (:nicknames :fsa.inv :inventory :πŸŽ’) - (:use :cl) - (:export #:inventory-state #:make-inventory-state)) - (in-package :flora-search-aurora.inventory) diff --git a/overworld.lisp b/overworld.lisp index 38ac26d..afdedef 100644 --- a/overworld.lisp +++ b/overworld.lisp @@ -17,25 +17,6 @@ ;;;; All game-functions and data relating to the β€œoverworld” (that is, ;;;; the primary gameplay, the RPG-ish-ish bits). -(defpackage :flora-search-aurora - (:nicknames :fsa :✿) - (:export :player)) - - -(defpackage :flora-search-aurora.overworld - (:nicknames :fsa.o :overworld :🌍) - (:use :cl - :flora-search-aurora.overworld.util) - (:export #:overworld-state #:make-overworld-state #:overworld-state-draw - #:merge-maps - #:world-coords->screen-coords - #:getf-entity #:getf-entity-data #:removef-entity - #:aget-item #:getf-act #:getf-know - #:move-entity-to #:move-entity - #:plist->map - :left :right)) - - (in-package :flora-search-aurora.overworld) diff --git a/overworld.util.lisp b/overworld.util.lisp index e776cc9..e6d65f0 100644 --- a/overworld.util.lisp +++ b/overworld.util.lisp @@ -16,16 +16,6 @@ ;;;; FLORA-SEARCH-AURORA.OVERWORLD.UTIL ;;;; Utility functions used by multiple overworld packages (overworld.tiled & overworld). -(defpackage :flora-search-aurora.overworld.util - (:nicknames :fsa.o.u :overworld.util :🌍.…) - (:use :cl) - (:export #:coords->symbol #:symbol->coords - #:world-coords->screen-coords - #:world-coords-chunk - #:map->plist #:plist->map - #:string->symbol - #:save-map-to-file)) - (in-package :flora-search-aurora.overworld.util) diff --git a/packages.lisp b/packages.lisp new file mode 100644 index 0000000..a0beace --- /dev/null +++ b/packages.lisp @@ -0,0 +1,99 @@ +;;;; Copyright Β© 2023, Jaidyn Ann +;;;; +;;;; This program is free software: you can redistribute it and/or +;;;; modify it under the terms of the GNU General Public License as +;;;; published by the Free Software Foundation, either version 3 of +;;;; the License, or (at your option) any later version. +;;;; +;;;; This program is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with this program. If not, see . + +;;;; This contains package definitions for Flora Serĉ’ Kolora. + +(defpackage :flora-search-aurora.util + (:nicknames :fsa.utl :util :…) + (:use :cl :assoc-utils) + (:export #:split-string-by-length + #:plist= + #:incf-0 + #:at-least #:at-most + #:system-language #:langcode->keysym #:getf-lang)) + +(defpackage :flora-search-aurora.input + (:use :cl) + (:nicknames :fsa.imp :input :⌨) + (:export #:read-char-plist #:read-gamefied-char-plist + #:normalize-char-plist #:gameify-char-plist + #:plist-char-p + :control :meta :shift + +qwerty-layout+ +dvorak-layout+ + +arrows-game-layout+ +wasd-game-layout+ +ijkl-game-layout+ + :↑ :← :β†’ :↓ :πŸ†— :❎)) + +(defpackage :flora-search-aurora.display + (:nicknames :fsa.d :display :✎) + (:use :cl) + (:export #:make-screen-matrix #:print-screen-matrix #:matrix-delta + #:hide-cursor #:show-cursor #:clear-screen)) + +(defpackage :flora-search-aurora.ui + (:nicknames :fsa.u :ui :πŸ“‹) + (:use :cl :assoc-utils) + (:export #:menu-state #:make-menu-state + #:render-line #:render-string #:render-string-partially + :label :selection :selected)) + +(defpackage :flora-search-aurora.dialogue + (:nicknames :fsa.dia :dialogue :πŸ’¬) + (:use :cl) + (:export #:dialogue-state #:make-dialogue-state + #:start-dialogue #:face #:say #:mumble #:move + :normal-face :talking-face)) + +(defpackage :flora-search-aurora.inventory + (:nicknames :fsa.inv :inventory :πŸŽ’) + (:use :cl) + (:export #:inventory-state #:make-inventory-state)) + +(defpackage :flora-search-aurora.overworld.util + (:nicknames :fsa.o.u :overworld.util :🌍.…) + (:use :cl) + (:export #:coords->symbol #:symbol->coords + #:world-coords->screen-coords + #:world-coords-chunk + #:map->plist #:plist->map + #:string->symbol + #:save-map-to-file)) + +(defpackage :flora-search-aurora.overworld + (:nicknames :fsa.o :overworld :🌍) + (:use :cl + :flora-search-aurora.overworld.util) + (:export #:overworld-state #:make-overworld-state #:overworld-state-draw + #:merge-maps + #:world-coords->screen-coords + #:getf-entity #:getf-entity-data #:removef-entity + #:aget-item #:getf-act #:getf-know + #:move-entity-to #:move-entity + #:plist->map + :left :right)) + +(defpackage :flora-search-aurora.engine + (:nicknames :fsa.eng :engine :βš™) + (:export #:state-loop #:main) + (:use :cl)) + +(defpackage :flora-search-aurora + (:nicknames :fsa :✿) + (:export #:main + :player) + (:use :cl + :flora-search-aurora.input :flora-search-aurora.display + :flora-search-aurora.overworld :flora-search-aurora.dialogue + :flora-search-aurora.ui)) + diff --git a/res/maps/tmxβ†’lisp.lisp b/res/maps/tmxβ†’lisp.lisp index 5367486..321cf2d 100644 --- a/res/maps/tmxβ†’lisp.lisp +++ b/res/maps/tmxβ†’lisp.lisp @@ -1,13 +1,9 @@ (ql:quickload '(alexandria cl-tiled assoc-utils str uiop)) +(load "packages.lisp") (load "util.lisp") (load "overworld.util.lisp") (load "overworld.tiled.lisp") -(defpackage :flora-search-aurora - (:nicknames :fsa :✿) - (:export #:main) - (:use :cl)) - (defun local-path (subpath) (format nil "~A~A" (uiop:getcwd) subpath)) @@ -21,3 +17,5 @@ ":FLORA-SEARCH-AURORA" (format nil "*~A-map*" map-name))) '("casino" "outdoors" "flashback-school")) + +(quit) diff --git a/ui.lisp b/ui.lisp index 8ed67df..384d253 100644 --- a/ui.lisp +++ b/ui.lisp @@ -17,13 +17,6 @@ ;;;; Generic menu-making, displaying, and management. ;;;; Let's get to it, we're on a deadline! -(defpackage :flora-search-aurora.ui - (:nicknames :fsa.u :ui :πŸ“‹) - (:use :cl :assoc-utils) - (:export #:menu-state #:make-menu-state - #:render-line #:render-string #:render-string-partially - :label :selection :selected)) - (in-package :flora-search-aurora.ui) diff --git a/util.lisp b/util.lisp index 29d7b76..190ed8b 100644 --- a/util.lisp +++ b/util.lisp @@ -13,19 +13,10 @@ ;;;; You should have received a copy of the GNU General Public License ;;;; along with this program. If not, see . -;;;; FLORA-SEARCH-AURORA.UI -;;;; Generic menu-making, displaying, and management. +;;;; FLORA-SEARCH-AURORA.UTIL +;;;; Useful misc. utilities used in multiple packages. ;;;; Let's get to it, we're on a deadline! -(defpackage :flora-search-aurora.util - (:nicknames :fsa.ut :util :…) - (:use :cl :assoc-utils) - (:export #:split-string-by-length - #:plist= - #:incf-0 - #:at-least #:at-most - #:system-language #:langcode->keysym #:getf-lang)) - (in-package :flora-search-aurora.util)