Skip to content

Commit efeab94

Browse files
Refactor OOP classes
1 parent 52b1d0b commit efeab94

35 files changed

+203
-296
lines changed

.github/workflows/validate.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ on:
66
- 'elements/**/*.yaml'
77
- 'events/**/*.yaml'
88
- 'functions/**/*.yaml'
9-
- 'classes/**/*.yaml'
109
- 'schemas/**/*.yaml'
1110
pull_request:
1211
paths:
1312
- 'elements/**/*.yaml'
1413
- 'events/**/*.yaml'
1514
- 'functions/**/*.yaml'
16-
- 'classes/**/*.yaml'
1715
- 'schemas/**/*.yaml'
1816
workflow_dispatch:
1917

.vscode/settings.json

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

classes/Vector/Vector4.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

classes/Matrix/Matrix.yaml renamed to elements/Matrix/Matrix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'matrix'
22
description: |
33
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.
44
5-
methods:
5+
oop_methods:
66
- name: create
77
description: |
88
Default constructor for the Matrix class. Returns a Matrix object.

classes/Vector/Vector2.yaml renamed to elements/Vector/Vector2.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
name: 'vector2'
22
description: |
33
This is a 2D [Vector](/Vector) class.
4-
methods:
4+
oop_methods:
55
- name: create
66
description: |
77
Default constructor for the Vector2 class. Returns a Vector2 object.
8-
overloads:
9-
- signature: Vector2(mixed vectorOrX[, float y])
10-
parameters:
11-
- name: vectorOrX
12-
type: float | table | vector2
13-
description: Vector2, table, or float indicating vector's coordinates
14-
- name: y
15-
type: float
16-
optional: true
17-
description: If vectorOrX is a float, this is the Y coordinate
8+
signature: Vector2(mixed vectorOrX[, float y])
9+
parameters:
10+
- name: vectorOrX
11+
type: float | table | vector2
12+
description: Vector2, table, or float indicating vector's coordinates
13+
- name: y
14+
type: float
15+
optional: true
16+
description: If vectorOrX is a float, this is the Y coordinate
1817

1918
- name: normalize
2019
description: Normalizes the vector

classes/Vector/Vector3.yaml renamed to elements/Vector/Vector3.yaml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,23 @@ name: Vector3
22
type: class
33
description: |
44
Represents a 3D [Vector](/Vector). Used for storing and manipulating three-dimensional coordinates (x, y, z).
5-
methods:
5+
oop_methods:
66
- name: create
77
description: |
88
Default constructor for the Vector3 class. Returns a Vector3 object.
9-
overloads:
10-
- signature: Vector3(mixed vectorOrX[, float y, float z])
11-
parameters:
12-
- name: vectorOrX
13-
type: float | table | vector3
14-
description: Vector3, table, or floats indicating vector's coordinates
15-
- name: y
16-
type: float
17-
optional: true
18-
description: If vectorOrX is a float, this is the Y coordinate
19-
- name: z
20-
type: float
21-
optional: true
22-
description: If vectorOrX is a float, this is the Z coordinate
9+
signature: Vector3(mixed vectorOrX[, float y, float z])
10+
parameters:
11+
- name: vectorOrX
12+
type: float | table | vector3
13+
description: Vector3, table, or floats indicating vector's coordinates
14+
- name: y
15+
type: float
16+
optional: true
17+
description: If vectorOrX is a float, this is the Y coordinate
18+
- name: z
19+
type: float
20+
optional: true
21+
description: If vectorOrX is a float, this is the Z coordinate
2322

2423
- name: cross
2524
type: method

elements/Vector/Vector4.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Vector4
2+
type: class
3+
description: |
4+
Represents a 4D [Vector](/Vector).
5+
oop_methods:
6+
- name: create
7+
description: |
8+
Default constructor for the Vector4 class. Returns a Vector4 object.
9+
signature: Vector4(mixed vectorOrX[, float y, float z, float w])
10+
parameters:
11+
- name: vectorOrX
12+
type: float | table | vector4
13+
description: Vector4, table, or floats indicating vector's coordinates
14+
- name: y
15+
type: float
16+
optional: true
17+
description: If vectorOrX is a float, this is the Y coordinate
18+
- name: z
19+
type: float
20+
optional: true
21+
description: If vectorOrX is a float, this is the Z coordinate
22+
- name: w
23+
type: float
24+
optional: true
25+
description: If vectorOrX is a float, this is the W coordinate
26+
27+
examples:
28+
- path: examples/vector4-1.lua
29+
description: This example adds a command called "/garage", allowing you to get any garage bounding box.

0 commit comments

Comments
 (0)