@quenty/teamutils 10.23.0 → 10.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +2 -2
- package/src/Shared/RxTeamUtils.lua +12 -0
- package/src/Shared/TeamUtils.lua +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [10.24.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/teamutils@10.23.0...@quenty/teamutils@10.24.0) (2026-01-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add luau typing to a variety of classes ([0271856](https://github.com/Quenty/NevermoreEngine/commit/0271856de02cc28c1d1d512c43bd6adeeaa41587))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [10.23.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/teamutils@10.22.2...@quenty/teamutils@10.23.0) (2026-01-13)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/teamutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/teamutils",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.24.0",
|
|
4
4
|
"description": "Team utility methods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"@quenty/maid": "3.5.3",
|
|
38
38
|
"@quenty/rx": "13.22.0"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8d2e7927e4399b4297a04d474d29bdd85692051d"
|
|
41
41
|
}
|
|
@@ -18,6 +18,12 @@ local RxInstanceUtils = require("RxInstanceUtils")
|
|
|
18
18
|
|
|
19
19
|
local RxTeamUtils = {}
|
|
20
20
|
|
|
21
|
+
--[=[
|
|
22
|
+
Observes the team of a player, returning nil if neutral.
|
|
23
|
+
|
|
24
|
+
@param player Player
|
|
25
|
+
@return Observable<Team?>
|
|
26
|
+
]=]
|
|
21
27
|
function RxTeamUtils.observePlayerTeam(player: Player): Observable.Observable<Team?>
|
|
22
28
|
return Rx.combineLatest({
|
|
23
29
|
team = RxInstanceUtils.observeProperty(player, "Team"),
|
|
@@ -33,6 +39,12 @@ function RxTeamUtils.observePlayerTeam(player: Player): Observable.Observable<Te
|
|
|
33
39
|
}) :: any
|
|
34
40
|
end
|
|
35
41
|
|
|
42
|
+
--[=[
|
|
43
|
+
Observes the team color of a player, returning nil if neutral. This handles team changes properly.
|
|
44
|
+
|
|
45
|
+
@param player Player
|
|
46
|
+
@return Observable<BrickColor?>
|
|
47
|
+
]=]
|
|
36
48
|
function RxTeamUtils.observePlayerTeamColor(player: Player): Observable.Observable<BrickColor?>
|
|
37
49
|
return RxTeamUtils.observePlayerTeam(player):Pipe({
|
|
38
50
|
Rx.switchMap(function(team: Team?): any
|
package/src/Shared/TeamUtils.lua
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Team utility methods
|
|
4
4
|
@class TeamUtils
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
local TeamUtils = {}
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
--[=[
|
|
10
|
+
Returns whether the two players are on the same team
|
|
11
|
+
]=]
|
|
12
|
+
function TeamUtils.areTeamMates(playerA: Player, playerB: Player): boolean
|
|
10
13
|
local teamA = TeamUtils.getTeam(playerA)
|
|
11
14
|
local teamB = TeamUtils.getTeam(playerB)
|
|
12
15
|
if not teamA or not teamB then
|
|
@@ -16,7 +19,10 @@ function TeamUtils.areTeamMates(playerA, playerB)
|
|
|
16
19
|
return teamA == teamB
|
|
17
20
|
end
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
--[=[
|
|
23
|
+
Returns the team of the player, or nil if the player is neutral
|
|
24
|
+
]=]
|
|
25
|
+
function TeamUtils.getTeam(player: Player): Team?
|
|
20
26
|
if player.Neutral then
|
|
21
27
|
return nil
|
|
22
28
|
end
|