<commit_before>(ns korhal.core
  (:import (jnibwapi.JNIBWAPI)
           (jnibwapi.BWAPIEventListener)
           (jnibwapi.model.Unit)
           (jnibwapi.util.BWColor)))

(gen-class
 :name "korhal.core"
 :implements [jnibwapi.BWAPIEventListener]
 :state "state"
 :main true
 :constructors {[] []}
 :prefix "korhal-")

(defn korhal-main [& args]
  (let [ai (new korhal.core)]
    (.start (jnibwapi.JNIBWAPI. ai))))

(defn korhal-init [this] [[] "state"])

(defn korhal-connected [this])
(defn korhal-gameStarted [this])
(defn korhal-gameUpdate [this])
(defn korhal-gameEnded [this])
(defn korhal-keyPressed [this keycode])
(defn korhal-matchEnded [this winner])
(defn korhal-sendText [this text])
(defn korhal-receiveText [this text])
(defn korhal-nukeDetect [this x y])
(defn korhal-playerLeft [this playerID])
(defn korhal-unitCreate [this unitID])
(defn korhal-unitDestroy [this unitID])
(defn korhal-unitDiscover [this unitID])
(defn korhal-unitEvade [this unitID])
(defn korhal-unitHide [this unitID])
(defn korhal-unitMorph [this unitID])
(defn korhal-unitShow [this unitID])
(defn korhal-unitRenegade [this unitID])
(defn korhal-saveGame [this gameName])
(defn korhal-unitComplete [this unitID])
(defn korhal-playerDropped [this playerID])<commit_msg>Trying out state atom<commit_after>(ns korhal.core
  (:import (jnibwapi JNIBWAPI BWAPIEventListener)
           (jnibwapi.model Unit)
           (jnibwapi.util BWColor)))

(gen-class
 :name "korhal.core"
 :implements [JNIBWAPI]
 :state state
 :main true
 :constructors {[] []}
 :prefix "korhal-")

(defn korhal-main [& args]
  (let [ai (new korhal.core)
        api (JNIBWAPI. ai)]
    (compare-and-set! (.state ai) @(.state ai) (merge @(.state ai) {:api api}))
    (.start api))))

(defn korhal-init [this]
  [[] (atom {})])

(defn korhal-connected [this])

(defn korhal-gameStarted [this]
  (println "Here we go!")
  (doto (:api @(.state this))
    (.enableUserInput)
    (.enablePerfectInformation)
    (.setGameSpeed 0)
    (.loadMapData true)))

(defn korhal-gameUpdate [this])
(defn korhal-gameEnded [this])
(defn korhal-keyPressed [this keycode])
(defn korhal-matchEnded [this winner])
(defn korhal-sendText [this text])
(defn korhal-receiveText [this text])
(defn korhal-nukeDetect [this x y])
(defn korhal-playerLeft [this playerID])
(defn korhal-unitCreate [this unitID])
(defn korhal-unitDestroy [this unitID])
(defn korhal-unitDiscover [this unitID])
(defn korhal-unitEvade [this unitID])
(defn korhal-unitHide [this unitID])
(defn korhal-unitMorph [this unitID])
(defn korhal-unitShow [this unitID])
(defn korhal-unitRenegade [this unitID])
(defn korhal-saveGame [this gameName])
(defn korhal-unitComplete [this unitID])
(defn korhal-playerDropped [this playerID])
{'fraction_non_alphanumeric': 0.14979905005480454, 'fraction_numerical': 0.00036536353671903543, 'mean_word_length': 4.7642105263157895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6845152', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1032, 'n_words': 259}