Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ go.work

bin/
logs/
docs/api
external/bin
interpreter/kaiju-*
*.zip
Expand Down
26 changes: 21 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,32 @@
"CGO_ENABLED": "1",
}
}, {
"name": "Documentation Generator",
"name": "Generate Documentation",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/src/generators/api",
"program": "${workspaceFolder}/src/tools/gendocs.go",
"args": ["${workspaceFolder}/src"],
"cwd": "${workspaceFolder}",
"buildFlags": "-tags=generator",
"env": {
"CGO_ENABLED": "1",
}
"CGO_ENABLED": "1"
},
"console": "integratedTerminal",
"showLog": true,
"preLaunchTask": "Install gomarkdoc"
}, {
"name": "Install Dependencies and Generate Docs",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/src/tools/install_and_generate_docs.go",
"args": ["${workspaceFolder}/src"],
"cwd": "${workspaceFolder}",
"env": {
"CGO_ENABLED": "1"
},
"console": "integratedTerminal",
"showLog": true
}, {
"name": "Copy Headers",
"type": "go",
Expand Down
47 changes: 46 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,52 @@
"$go"
],
"group": "build",
"detail": "go build ${workspaceFolder}/src",
"detail": "go build ${workspaceFolder}/src"
}, {
"label": "Generate Documentation",
"type": "shell",
"command": "go",
"args": [
"run",
"${workspaceFolder}/src/tools/gendocs.go",
"${workspaceFolder}/src"
],
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": [],
"detail": "Generate API documentation using go doc"
}, {
"label": "Install gomarkdoc",
"type": "shell",
"command": "go",
"args": [
"install",
"github.com/princjef/gomarkdoc/cmd/gomarkdoc@latest"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": [],
"detail": "Install gomarkdoc dependency"
}
]
}
51 changes: 51 additions & 0 deletions docs/api/bootstrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->

# bootstrap

```go
import "kaijuengine.com/bootstrap"
```

## Index

- [func Main\(game GameInterface, platformState any\)](<#Main>)
- [type GameInterface](<#GameInterface>)


<a name="Main"></a>
## func [Main](<https://github.com/JrSchmidtt/kaiju/blob/master/src/bootstrap/bootstrap.go#L45>)

```go
func Main(game GameInterface, platformState any)
```



<a name="GameInterface"></a>
## type [GameInterface](<https://github.com/JrSchmidtt/kaiju/blob/master/src/bootstrap/game_interface.go#L47-L65>)

GameInterface is the primary interface to implement in order to bootstrap a game/application.

```go
type GameInterface interface {
// Launch is used to bootstrap a game, the game should fill out this
// function's details to initialize itself. No updates are provided by the
// engine, so it is on the the implementing code to take care of registering
// any udpates with the supplied host.
Launch(*engine.Host)

// PluginRegistry is used to expose types to be exported for use in Lua.
// Any type returned here will have it's members and functions mapped to
// be called by Lua. You can run the engine with the command line argument
// "generate=pluginapi" to dump a Lua API file and ensure your exposed
// types have been correctly inserted.
PluginRegistry() []reflect.Type

// ContentDatabase must return the database interface for the engine to use
// when it is trying to access content. You can use exsiting types that
// implement [assets.Database], or you can create your own.
ContentDatabase() (assets.Database, error)
}
```

Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
112 changes: 112 additions & 0 deletions docs/api/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!-- Code generated by gomarkdoc. DO NOT EDIT -->

# debug

```go
import "kaijuengine.com/debug"
```

## Index

- [Variables](<#variables>)
- [func Assert\(res bool, msg string\)](<#Assert>)
- [func Ensure\(res bool\)](<#Ensure>)
- [func EnsureMsg\(res bool, msg string\)](<#EnsureMsg>)
- [func EnsureNotError\(err error\)](<#EnsureNotError>)
- [func EnsureNotNil\(target any\)](<#EnsureNotNil>)
- [func Halt\(msg string\)](<#Halt>)
- [func Log\(msg string, args ...any\)](<#Log>)
- [func Throw\(message string\)](<#Throw>)
- [func ThrowNotImplemented\(todo string\)](<#ThrowNotImplemented>)


## Variables

<a name="NotImplementedError"></a>

```go
var NotImplementedError = errors.New("not implemented")
```

<a name="Assert"></a>
## func [Assert](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L54>)

```go
func Assert(res bool, msg string)
```



<a name="Ensure"></a>
## func [Ensure](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L71>)

```go
func Ensure(res bool)
```



<a name="EnsureMsg"></a>
## func [EnsureMsg](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L79>)

```go
func EnsureMsg(res bool, msg string)
```



<a name="EnsureNotError"></a>
## func [EnsureNotError](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L88>)

```go
func EnsureNotError(err error)
```



<a name="EnsureNotNil"></a>
## func [EnsureNotNil](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L96>)

```go
func EnsureNotNil(target any)
```



<a name="Halt"></a>
## func [Halt](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L64>)

```go
func Halt(msg string)
```



<a name="Log"></a>
## func [Log](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L48>)

```go
func Log(msg string, args ...any)
```



<a name="Throw"></a>
## func [Throw](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L103>)

```go
func Throw(message string)
```



<a name="ThrowNotImplemented"></a>
## func [ThrowNotImplemented](<https://github.com/JrSchmidtt/kaiju/blob/master/src/debug/assertions.go#L102>)

```go
func ThrowNotImplemented(todo string)
```



Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
Loading
Loading