-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
60 lines (51 loc) · 1.73 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require('mobdebug').start(); -- enable debugging checkpoints
StartDebug(); -- enable debugging
mod = RegisterMod("AI Final", 1); -- register mod in game
-------------------------
-------- IMPORTS --------
-------------------------
-- Write str to the Isaac Console
function CPrint(str)
Isaac.ConsoleOutput(str.."\n")
end
function import(filename)
local _, err = pcall(require, filename)
err = tostring(err)
if not string.match(err, "attempt to call a nil value %(method 'ForceError'%)") then
if string.match(err, "true") then
err = "Error: require passed in config"
end
-- don't print this because we import files we don't want tot throw errors
-- CPrint(err)
end
end
-- data structures
import("data_structures.stack")
import("data_structures.queue")
import("data_structures.priority_queue")
-- utility functions
import("utils.lua_utils")
import("utils.print_utils")
import("utils.isaac_utils")
import("utils.isaac_types")
import("utils.pedestal_items")
-- callback hooks
import("callbacks.on_game_start")
import("callbacks.on_level_start")
import("callbacks.on_room_start")
import("callbacks.on_damage") -- doesn't do anything yet, might want to use this for scoring the agent
import("callbacks.on_input_request")
import("callbacks.on_step")
-- AI implementations and drivers
import("ai.agents")
import("ai.room_search")
import("ai.level_search")
import("ai.navigator")
--------------------------------
-------- PROJECT HEADER --------
--------------------------------
CPrint("----------------------------------")
CPrint("--- CS4100 Project Initialized ---")
CPrint("----------------------------------")
CPrint("")
modEnabled = true