Sort systems by priority
This commit is contained in:
parent
69f1f584ea
commit
700b7a9cda
1 changed files with 10 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
(import scheme
|
||||
(chicken base)
|
||||
(chicken module)
|
||||
(chicken sort)
|
||||
raylib
|
||||
(srfi 1)
|
||||
(srfi 69)
|
||||
|
|
@ -171,6 +172,13 @@
|
|||
(lambda (n el)
|
||||
(eqv? n (system-name el))))))
|
||||
|
||||
;; Sort the systems list by priority
|
||||
(define (sort-systems)
|
||||
(sort! systems
|
||||
(lambda (x y)
|
||||
(< (system-priority x)
|
||||
(system-priority y)))))
|
||||
|
||||
;; System addition/deletion queues
|
||||
(define add-system-queue '())
|
||||
(define del-system-queue '())
|
||||
|
|
@ -204,7 +212,8 @@
|
|||
;; Resolve all queued system changes
|
||||
(define (resolve-system-queue)
|
||||
(remove-queued-systems)
|
||||
(add-queued-systems))
|
||||
(add-queued-systems)
|
||||
(sort-systems))
|
||||
|
||||
;; System creation/removal interface
|
||||
(export add-system remove-system)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue