idk
This commit is contained in:
File diff suppressed because one or more lines are too long
23
project.org
23
project.org
@@ -1,9 +1,18 @@
|
|||||||
#+title: Our World
|
#+title: Our World
|
||||||
|
|
||||||
* Subsystems
|
* Buddho
|
||||||
** ECS
|
** Documentation
|
||||||
** Event Loop
|
*** TODO base documentation
|
||||||
** Map system
|
|
||||||
** Utilities
|
* No Intellect
|
||||||
*** Logging
|
** Tooling
|
||||||
** Selectors
|
** Documentation
|
||||||
|
** Physics
|
||||||
|
*** Space
|
||||||
|
**** TODO Notion of spatial object
|
||||||
|
**** TODO Rendering of spatial objects
|
||||||
|
**** TODO Moving of sp. o.
|
||||||
|
|
||||||
|
* Game
|
||||||
|
** Design
|
||||||
|
*** TODO base design documentation
|
||||||
|
@@ -12,5 +12,5 @@
|
|||||||
:builds
|
:builds
|
||||||
{:frontend
|
{:frontend
|
||||||
{:target :browser
|
{:target :browser
|
||||||
:modules {:main {:init-fn sekai.core.init/init}}
|
:modules {:main {:init-fn game.core.init/init}}
|
||||||
}}}
|
}}}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
(ns buddho.macros.dhamma
|
(ns buddho.macros.dhamma
|
||||||
(:require [clojure.set :as set]))
|
(:require [clojure.set :as set]))
|
||||||
|
|
||||||
|
(declare defdhamma)
|
||||||
|
|
||||||
(defmacro defconstructor
|
(defmacro defconstructor
|
||||||
"Create a dhamma constructor.
|
"Create a dhamma constructor.
|
||||||
For `dh-name`, constructor function will be bound to `dh-name!`.
|
For `dh-name`, constructor function will be bound to `dh-name!`.
|
||||||
@@ -38,16 +40,22 @@
|
|||||||
"
|
"
|
||||||
[dh-name & {:keys [meta data defaults dh-defaults]
|
[dh-name & {:keys [meta data defaults dh-defaults]
|
||||||
:or {meta {} data {} dh-defaults {}}}]
|
:or {meta {} data {} dh-defaults {}}}]
|
||||||
`(defn ~(symbol (str dh-name "!"))
|
`(do
|
||||||
|
(defn ~(symbol (str dh-name "!"))
|
||||||
[& {:keys [~@(concat (keys meta) (keys data)) ~'dh-args]
|
[& {:keys [~@(concat (keys meta) (keys data)) ~'dh-args]
|
||||||
:or ~defaults}]
|
:or ~defaults}]
|
||||||
(#'buddho.core.dhamma/register-dhamma!
|
(#'buddho.core.dhamma.state/register-dhamma!
|
||||||
~(keyword dh-name)
|
~(keyword dh-name)
|
||||||
(merge
|
(merge
|
||||||
~(merge dh-defaults
|
~(merge dh-defaults
|
||||||
{:data (set/map-invert data)}
|
{:data (set/map-invert data)}
|
||||||
{:meta {(keyword dh-name) (set/map-invert meta)}})
|
{:meta {(keyword dh-name) (set/map-invert meta)}})
|
||||||
~'dh-args))))
|
~'dh-args)))
|
||||||
|
|
||||||
|
(defdhamma
|
||||||
|
~(symbol (str dh-name ".construct")))
|
||||||
|
|
||||||
|
))
|
||||||
|
|
||||||
(defn extraction-bindings [datasym bindings extractor defaults]
|
(defn extraction-bindings [datasym bindings extractor defaults]
|
||||||
`(~datasym
|
`(~datasym
|
||||||
@@ -94,8 +102,10 @@
|
|||||||
{:keys [data meta
|
{:keys [data meta
|
||||||
defaults
|
defaults
|
||||||
dh-defaults
|
dh-defaults
|
||||||
meta-as data-as]
|
meta-as data-as
|
||||||
:or {defaults {}}}
|
make-constructor]
|
||||||
|
:or {defaults {}
|
||||||
|
make-constructor true}}
|
||||||
& body]
|
& body]
|
||||||
(let [kw (keyword name)
|
(let [kw (keyword name)
|
||||||
default-data
|
default-data
|
||||||
@@ -107,29 +117,30 @@
|
|||||||
(map (fn [[k v]] [v (defaults k)]))
|
(map (fn [[k v]] [v (defaults k)]))
|
||||||
(into {}))]
|
(into {}))]
|
||||||
`(do
|
`(do
|
||||||
(defconstructor ~name
|
(when ~make-constructor
|
||||||
:data ~data
|
(defconstructor ~name
|
||||||
:meta ~meta
|
:data ~data
|
||||||
:dh-defaults ~dh-defaults
|
:meta ~meta
|
||||||
:defaults ~defaults)
|
:dh-defaults ~dh-defaults
|
||||||
|
:defaults ~defaults))
|
||||||
|
|
||||||
(#'buddho.core.state/describe-dhamma!
|
(#'buddho.core.describe/describe-dhamma!
|
||||||
~kw
|
~kw
|
||||||
~docstring)
|
~docstring)
|
||||||
|
|
||||||
(defmethod buddho.core.dhamma/impl! ~kw ~(symbol (str "impl-" name))
|
(defmethod buddho.core.dhamma.occur/impl! ~kw ~(symbol (str "impl-" name))
|
||||||
[~'dhamma & [~'parent]]
|
[~'dhamma & [~'parent]]
|
||||||
(let [~@(when (or data data-as)
|
(let [~@(when (or data data-as)
|
||||||
(extraction-bindings
|
(extraction-bindings
|
||||||
(or data-as `data#)
|
(or data-as `data#)
|
||||||
data
|
data
|
||||||
'#'buddho.core.dhamma/extract-data
|
'#'buddho.core.dhamma.data/extract-data
|
||||||
default-data))
|
default-data))
|
||||||
|
|
||||||
~@(when (or meta meta-as)
|
~@(when (or meta meta-as)
|
||||||
(extraction-bindings
|
(extraction-bindings
|
||||||
(or meta-as `meta#)
|
(or meta-as `meta#)
|
||||||
meta
|
meta
|
||||||
'#'buddho.core.dhamma/extract-meta
|
'#'buddho.core.dhamma.data/extract-meta
|
||||||
default-meta))]
|
default-meta))]
|
||||||
~@body)))))
|
~@body)))))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
(ns buddho.core.dhamma.occur
|
(ns buddho.core.dhamma.occur
|
||||||
"Implementation of dhamma occurence mechanism."
|
"Implementation of dhamma occurence mechanism."
|
||||||
(:require [buddho.core.state :as s :refer [value]]
|
(:require [buddho.core.state.protocols :as s :refer [value]]
|
||||||
[buddho.core.dhamma.aspects :refer [pop-asp-stage]]
|
[buddho.core.dhamma.aspects :refer [pop-asp-stage]]
|
||||||
[buddho.core.dhamma.data :refer [make-dhamma]]))
|
[buddho.core.dhamma.data :refer [make-dhamma]]))
|
||||||
|
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
(ns buddho.dhamma.state
|
(ns buddho.dhamma.state
|
||||||
(:require [buddho.core.dhamma :as d]
|
(:require [buddho.core.dhamma.return :as ret]
|
||||||
[buddho.core.meta :as meta]
|
[buddho.core.state.idea :as idea])
|
||||||
[buddho.core.state :as s]
|
|
||||||
[sekai.math.vectors :as vect])
|
|
||||||
(:require-macros [buddho.macros.dhamma :refer [defdhamma]]))
|
(:require-macros [buddho.macros.dhamma :refer [defdhamma]]))
|
||||||
|
|
||||||
(defdhamma have-idea
|
(defdhamma have-idea
|
||||||
@@ -15,9 +13,9 @@ Mind: pulls _fields_ from only *one* dhamma, but will pull _data_ from *both* dh
|
|||||||
:data-as all-data}
|
:data-as all-data}
|
||||||
|
|
||||||
;; TODO error if no fields specified
|
;; TODO error if no fields specified
|
||||||
(let [idea (s/have-idea!)
|
(let [idea (idea/have-idea!)
|
||||||
; fields (or fields (keys all-data))
|
; fields (or fields (keys all-data))
|
||||||
data (zipmap fields (map all-data fields))]
|
data (zipmap fields (map all-data fields))]
|
||||||
(s/update-idea! idea data)
|
(idea/update-idea! idea data)
|
||||||
(d/with-return parent :have-idea
|
(ret/with-return parent :have-idea
|
||||||
{return-field idea})))
|
{return-field idea})))
|
||||||
|
4
src/cljs/game/core/init.cljs
Normal file
4
src/cljs/game/core/init.cljs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
(ns game.core.init)
|
||||||
|
|
||||||
|
(defn init []
|
||||||
|
(print "hello"))
|
@@ -1,4 +1,4 @@
|
|||||||
(ns sekai.graphics.pixi.canvas
|
(ns no_intellect.graphics.pixi.canvas
|
||||||
(:require ["pixi.js" :as PIXI]
|
(:require ["pixi.js" :as PIXI]
|
||||||
[buddho.core.state.idea :as idea]
|
[buddho.core.state.idea :as idea]
|
||||||
[buddho.core.state.property :as prop]))
|
[buddho.core.state.property :as prop]))
|
@@ -1,5 +0,0 @@
|
|||||||
(ns sekai.core.init)
|
|
||||||
|
|
||||||
(defn init []
|
|
||||||
(print "chuu")
|
|
||||||
)
|
|
Reference in New Issue
Block a user