olavim / RoundsWithFriends

ROUNDS multiplayer mod
GNU General Public License v3.0
34 stars 15 forks source link

Made Deathmatch score values accessible. #10

Closed willuwontu closed 3 years ago

willuwontu commented 3 years ago

Currently reflection is needed to get the current points and rounds of a team when using RWF. This will allow them to be accessed outside of RWF, while keeping the ability to set them as internal only.

olavim commented 3 years ago

@willuwontu The GameModeHandler abstraction from UnboundLib should allow you to get the current score. Have you tried it? For example, to get the score of team 1 in the currently active game mode, you would say

var team1Score = GameModeManager.CurrentHandler.GetTeamScore(0);

See the full implementation in https://github.com/Rounds-Modding/UnboundLib/tree/main/UnboundLib/GameModes and https://github.com/olavim/RoundsWithFriends/tree/main/RoundsWithFriends/GameModes.

willuwontu commented 3 years ago

I had not found that, thanks!