Skip to content

Commit 79a2e90

Browse files
committed
0.1.0
1 parent 954a300 commit 79a2e90

File tree

9 files changed

+43
-26
lines changed

9 files changed

+43
-26
lines changed

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "axi-docs",
3-
"version": "0.0.0",
3+
"version": "0.1.0",
44
"description": "Documentation for axi",
55
"scripts": {
66
"dev": "vitepress dev",

docs/src/core-apis/ecs.md

+29
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,32 @@ we can:
9696
- Get the component, or put it if it does not exist
9797
- Set the component
9898
- Obtain a delegating property to the component
99+
100+
## Creating a system
101+
102+
To create a system, you will need to implement the `System`
103+
interface and provide component archetypes this system filters:
104+
105+
```kt
106+
object ExampleSystem : System {
107+
override val archetypes: Sequence<KClass<out Any>> = sequenceOf(Position::class)
108+
109+
override suspend fun tick(tick: Int, attachable: Attachable) {
110+
// This will not be null because of our [archetypes] filter.
111+
val position = attachable.get<Position>()!!
112+
println("Attachable ${attachable.identity} is at position $position!")
113+
}
114+
}
115+
```
116+
117+
Now, we can start and stop ticking this system using the
118+
`System#start` and `System#stop` functions:
119+
120+
```kt
121+
class ExamplePlugin : AxiPlugin() {
122+
override suspend fun enable() {
123+
// ...
124+
ExampleSystem.start()
125+
}
126+
}
127+
```

docs/src/getting-started/examples.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Examples
22

3-
For an example, see 🔗 [**axi-example
4-
**](https://github.com/radstevee/axi/tree/master/example)
3+
For an example, see 🔗 [**axi-example**](https://github.com/radstevee/axi/tree/master/example).

docs/src/getting-started/quickstart.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ plugins {
4545
}
4646

4747
dependencies {
48-
axi.modules("core")
48+
axi.modules("core") // [!code focus]
4949
}
5050
```
5151
:::
@@ -83,7 +83,7 @@ And of course don't forget to add your `plugin.yml`:
8383

8484
```yml
8585
name: my-plugin
86-
version: 0.0.0
86+
version: 0.1.0
8787
api-version: 1.21.4
8888
main: my.axi.plugin.MyPlugin
8989
```
@@ -96,9 +96,9 @@ If you need a dependency in your plugin, you can use paper's
9696
library loading feature by adding the dependency using the
9797
`axi.runtime` function:
9898

99-
```kt
99+
```kts
100100
dependencies {
101-
axi.runtime("...")
101+
axi.runtime("...") // [!code focus]
102102
}
103103
```
104104

docs/src/ui/installation.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
# Installation
22

3-
To install the UI module, you need to add it to your dependencies:
3+
To install the UI module, simply add it to your `dependencies`
4+
block in your buildscript:
45

56
::: code-group
6-
7-
```kts{4} [build.gradle.kts]
8-
dependencies {
9-
implementation(platform("net.radstevee.axi:axi-bom:VERSION"))
10-
implementation("net.radstevee.axi:axi-core")
11-
implementation("net.radstevee.axi:axi-ui")
12-
}
13-
```
14-
15-
```groovy{4} [build.gradle]
7+
```kts [build.gradle.kts]
168
dependencies {
17-
implementation platform('net.radstevee.axi:axi-bom:VERSION')
18-
implementation 'net.radstevee.axi:axi-core'
19-
implementation 'net.radstevee.axi:axi-ui'
9+
axi.modules("core", "ui") // [!code focus]
2010
}
2111
```
22-
2312
:::
2413

2514
And now it is installed and will automatically be loaded!

example/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group = "net.radstevee.axi.example"
9-
version = "0.0.0"
9+
version = rootProject.version
1010

1111
dependencies {
1212
// We're not using the axi plugin here because

example/src/main/resources/plugin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
name: axi-example
2-
version: 0.0.0
2+
version: 0.1.0
33
main: net.radstevee.axi.example.ExampleAxiPlugin
44
api-version: 1.21.4

gradle-plugin/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ org.gradle.configuration-cache=true
66
org.gradle.parallel=true
77
org.gradle.vfs.watch=false
88

9-
version=0.0.0-SNAPSHOT
9+
version=0.1.0

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
77
org.gradle.parallel=true
88
org.gradle.vfs.watch=false
99

10-
version=0.0.0-SNAPSHOT
10+
version=0.1.0

0 commit comments

Comments
 (0)