Skip to content

Commit 96727f8

Browse files
add OOP classes
1 parent 93b4c01 commit 96727f8

21 files changed

+393
-85
lines changed

.github/workflows/validate.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ on:
66
- 'elements/**/*.yaml'
77
- 'events/**/*.yaml'
88
- 'functions/**/*.yaml'
9+
- 'classes/**/*.yaml'
910
- 'schemas/**/*.yaml'
1011
pull_request:
1112
paths:
1213
- 'elements/**/*.yaml'
1314
- 'events/**/*.yaml'
1415
- 'functions/**/*.yaml'
16+
- 'classes/**/*.yaml'
1517
- 'schemas/**/*.yaml'
1618
workflow_dispatch:
1719

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"schemas/function.yaml": "/functions/**/*",
44
"schemas/element.yaml": "/elements/**/*",
55
"schemas/event.yaml": "/events/**/*",
6+
"schemas/class.yaml": "/classes/**/*",
67
}
78
}

classes/Matrix/Matrix.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: 'matrix'
2+
description: |
3+
Matrices are one of the most powerful features of MTA [OOP](/OOP). We did have a presence of Matrices before with [getElementMatrix](/getElementMatrix), but we were given an ugly disgusting table to play with. Now, with the new Matrix class, we can make and magically manipulate Matrices.
4+

classes/Vector/Vector2.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: 'vector2'
2+
description: |
3+
This is a 2D [Vector](/Vector) class.
4+

classes/Vector/Vector3.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: 'vector3'
2+
description: |
3+
This is a 3D [Vector](/Vector) class.
4+

classes/Vector/Vector4.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: 'vector4'
2+
description: |
3+
This is a 4D [Vector](/Vector) class.
4+

schemas/class.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$schema: https://json-schema.org/draft/2020-12/schema
2+
$id: class.yaml
3+
title: OOP Class schema
4+
type: object
5+
required:
6+
- name
7+
- description
8+
properties:
9+
name:
10+
type: string
11+
description: Lowercase name of the OOP class.
12+
description:
13+
type: string
14+
description: Description of the OOP class.
15+
see_also:
16+
$ref: 'common-defs.yaml#/$defs/see_also'

tools/validate.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ for /r "elements" %%f in (*.yaml) do (
1111
for /r "events" %%f in (*.yaml) do (
1212
.\tools\yajsv.exe -s schemas/event.yaml -r schemas/common-defs.yaml "%%f"
1313
)
14+
15+
for /r "classes" %%f in (*.yaml) do (
16+
.\tools\yajsv.exe -s schemas/class.yaml -r schemas/common-defs.yaml "%%f"
17+
)

tools/validate.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
find 'functions/' -name '*.yaml' -type f -print0 | xargs -0 -I {} tools/yajsv -s schemas/function.yaml -r schemas/common-defs.yaml {}
44
find 'elements/' -name '*.yaml' -type f -print0 | xargs -0 -I {} tools/yajsv -s schemas/element.yaml -r schemas/common-defs.yaml {}
55
find 'events/' -name '*.yaml' -type f -print0 | xargs -0 -I {} tools/yajsv -s schemas/event.yaml -r schemas/common-defs.yaml {}
6+
find 'classes/' -name '*.yaml' -type f -print0 | xargs -0 -I {} tools/yajsv -s schemas/class.yaml -r schemas/common-defs.yaml {}

web/astro.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ export default defineConfig({
7272
{label: 'Server events', link: 'Server_Scripting_Events'},
7373
]
7474
},
75+
{
76+
label: 'OOP',
77+
items: [
78+
{label: 'About OOP', link: 'OOP'},
79+
{label: 'OOP Introduction', link: 'OOP_Introduction'},
80+
{label: 'OOP Classes', link: 'OOP_Classes'},
81+
]
82+
},
7583
{
7684
label: 'Elements',
7785
items: [

0 commit comments

Comments
 (0)