Rename core interface functions
This commit is contained in:
parent
be814a05da
commit
a6b767a943
2 changed files with 9 additions and 10 deletions
|
|
@ -52,8 +52,8 @@ If the game attempts to load a resource which has already been loaded, it will u
|
|||
|
||||
* Structure & Modules
|
||||
The ~engine~ folder contains core engine code, organised across the following modules:
|
||||
- ~(engine core)~ which contains core functionality including starting the window and game loop, functions for adding/removing systems, entities, and event buses.
|
||||
- This module also re-exports the bindings of SRFI-99, as we require those records for ~component-sets~ and other places.
|
||||
- ~(engine core)~ which contains core functionality including starting the window and game loop, and functions for adding/removing systems, entities, and event buses to/from the game state.
|
||||
- ~(engine components)~ which contains methods for creating and accessing components.
|
||||
- ~(engine systems)~ which contains functions for creating new systems.
|
||||
- ~(engine events)~ which contains functions for creating and interacting with event buses.
|
||||
- ~(engine resources)~ which contains functions for loading and using resources.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
(module (engine core) *
|
||||
(module (engine core) (add-entity add-named-entity remove-entity)
|
||||
(import scheme
|
||||
(chicken base)
|
||||
;; raylib
|
||||
|
|
@ -87,18 +87,17 @@
|
|||
del-entity-queue)
|
||||
(set! del-entity-queue '()))
|
||||
|
||||
;; Create an instance of an entity in the world and return it's ID
|
||||
(define (add-instance-named id . components)
|
||||
;; Create an entity in the world and return it's ID
|
||||
(define (add-named-entity id . components)
|
||||
(queue-add-entity id components)
|
||||
id)
|
||||
|
||||
;; Shortcut for anonymous instancing
|
||||
(define (add-instance . components)
|
||||
(apply add-instance-named (gensym) components))
|
||||
(define (add-entity . components)
|
||||
(apply add-named-entity (gensym) components))
|
||||
|
||||
;; Remove an instance from the world
|
||||
(define (remove-instance id)
|
||||
;; Remove an entity from the world
|
||||
(define (remove-entity id)
|
||||
(queue-del-entity id)
|
||||
id)
|
||||
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue