 (ns korhal.core
   (:require [korhal.interop.interop :refer :all]
-            [korhal.strategy.engine :refer [start-strategy-engine! stop-strategy-engine!
-                                            strategy-inform! strategy-expire!
-                                            strategy-remove!]]
-            [korhal.macro.engine :refer [start-macro-engine! stop-macro-engine!]]
-            [korhal.macro.state :refer [builder-to-constructor!
-                                        construction-completed!]]
-            [korhal.micro.engine :refer [start-micro-engine! stop-micro-engine!
-                                         micro-tag-new-unit!]]
             [korhal.tools.util :refer [swap-key swap-keys profile]]
             [korhal.tools.repl :refer :all]
-            [korhal.tools.queue :refer :all]
-            [korhal.tools.contract :refer [available-minerals available-gas
-                                           contract-build contracted-max-supply
-                                           clear-contracts cancel-contracts
-                                           show-contract-display clear-contract-atoms
-                                           can-build? contract-add-initial-cc
-                                           contract-add-new-building]])
+            [korhal.tools.queue :refer :all])
   (:import (clojure.lang.IDeref)
            (jnibwapi.JNIBWAPI)
            (jnibwapi.BWAPIEventListener)))

  (println "Game Started")
  (enable-user-input)
  (set-game-speed 10)
  (load-map-data true)
  (draw-targets true)
  (draw-ids true)
  (show-contract-display true)
  (start-repl! 7777))

(defn korhal-gameUpdate [this]
  ;; we have to do this here instead of korhal-gameStarted because frame does not
  ;; get reset to 0 until now when restarting a game
  (when (zero? (frame-count))
    (clear-contract-atoms)
    (contract-add-initial-cc)
    (start-strategy-engine!)
    (start-macro-engine!)
    (start-micro-engine!))
  (strategy-expire! :nukes 250) ;; estimated frames for a nuke to drop
  (clear-contracts)
  (execute-api-queue)
  (execute-repl-queue))

(defn korhal-gameEnded [this]
  (stop-strategy-engine!)
  (stop-macro-engine!)
  (stop-micro-engine!)
  (stop-repl!))

(defn korhal-keyPressed [this keycode])



(defn korhal-receiveText [this text])

(defn korhal-nukeDetect [this x y])

(defn korhal-playerLeft [this player-id])

(defn korhal-unitCreate [this unit-id])

(defn korhal-unitDestroy [this unit-id])

(defn korhal-unitDiscover [this unit-id])

(defn korhal-unitEvade [this unit-id])

(defn korhal-unitHide [this unit-id])

(defn korhal-unitMorph [this unit-id])

(defn korhal-unitShow [this unit-id])

(defn korhal-unitRenegade [this unit-id])

(defn korhal-saveGame [this game-name])

(defn korhal-unitComplete [this unit-id])

(defn korhal-playerDropped [this player-id])
