Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseScoringSystemComponent Class Reference
Inheritance diagram for SCR_BaseScoringSystemComponent:

Protected Member Functions

OnPlayerScoreChangedInvoker GetOnPlayerScoreChanged ()
OnFactionScoreChangedInvoker GetOnFactionScoreChanged ()
OnPlayerEventInvoker GetOnPlayerAdded ()
OnPlayerEventInvoker GetOnPlayerRemoved ()
override bool RplSave (ScriptBitWriter writer)
override bool RplLoad (ScriptBitReader reader)
void OnPlayerScoreChanged (int playerId, SCR_ScoreInfo scoreInfo)
void OnFactionScoreChanged (Faction faction, SCR_ScoreInfo scoreInfo)
int CalculateScore (SCR_ScoreInfo info)
int GetPlayerScore (int playerId)
SCR_ScoreInfo GetPlayerScoreInfo (int playerId)
int GetFactionScore (notnull Faction faction)
SCR_ScoreInfo GetFactionScoreInfo (notnull Faction faction)
override void OnPlayerRegistered (int playerId)
override void OnPlayerDisconnected (int playerId, KickCauseCode cause, int timeout)
override void EOnDiag (IEntity owner, float timeSlice)
int GetScoreLimit ()
override void EOnInit (IEntity owner)
override void OnPostInit (IEntity owner)
override void OnDelete (IEntity owner)

Protected Attributes

ref map< int, ref SCR_ScoreInfom_mPlayerScores = new map<int, ref SCR_ScoreInfo>()
ref map< Faction, ref SCR_ScoreInfom_mFactionScores = new map<Faction, ref SCR_ScoreInfo>()
 Map of scores per faction.
ref OnPlayerScoreChangedInvoker m_OnPlayerScoreChangedInvoker
 This invoker is invoked when score of provided player changes.
ref OnFactionScoreChangedInvoker m_OnFactionScoreChangedInvoker
 This invoker is invoked when score of provided faction changes.
ref OnPlayerEventInvoker m_OnPlayerAdded
 This invoker is invoked when a player is registered to the scoreboard.
ref OnPlayerEventInvoker m_OnPlayerRemoved
 This invoker is invoked when a player is registered to the scoreboard.

Detailed Description

This component serves as a base and interface for game mode scoring system.

It keeps track of individual player scores and manages replication of such values to all clients when necessary.

Scoring is implemented in authoritative way, ie. only the server can update score.

This component only keeps track of scores, but does not react or change the game flow in any way. For specialised logic inherit this component and implement custom logic.

Definition at line 26 of file SCR_BaseScoringSystemComponent.c.

Member Function Documentation

◆ CalculateScore()

int SCR_BaseScoringSystemComponent::CalculateScore ( SCR_ScoreInfo info)
inlineprotected

Calculate score for provided score info. Different kinds of score multipliers and evaluation can be calculated by overriding this method.

Parameters
[in]info
Returns

Definition at line 471 of file SCR_BaseScoringSystemComponent.c.

◆ EOnDiag()

override void SCR_BaseScoringSystemComponent::EOnDiag ( IEntity owner,
float timeSlice )
inlineprotected

Definition at line 550 of file SCR_BaseScoringSystemComponent.c.

◆ EOnInit()

override void SCR_BaseScoringSystemComponent::EOnInit ( IEntity owner)
inlineprotected

Definition at line 615 of file SCR_BaseScoringSystemComponent.c.

◆ GetFactionScore()

int SCR_BaseScoringSystemComponent::GetFactionScore ( notnull Faction faction)
inlineprotected
Returns
score of provided faction or 0 if none.

Definition at line 503 of file SCR_BaseScoringSystemComponent.c.

◆ GetFactionScoreInfo()

SCR_ScoreInfo SCR_BaseScoringSystemComponent::GetFactionScoreInfo ( notnull Faction faction)
inlineprotected
Returns
score info of provided faction or null if none.

Definition at line 514 of file SCR_BaseScoringSystemComponent.c.

◆ GetOnFactionScoreChanged()

OnFactionScoreChangedInvoker SCR_BaseScoringSystemComponent::GetOnFactionScoreChanged ( )
inlineprotected
Returns
invoker that is invoked when score of provided player changes.

Definition at line 53 of file SCR_BaseScoringSystemComponent.c.

◆ GetOnPlayerAdded()

OnPlayerEventInvoker SCR_BaseScoringSystemComponent::GetOnPlayerAdded ( )
inlineprotected
Returns
invoker that is invoked when any score changes.

Definition at line 66 of file SCR_BaseScoringSystemComponent.c.

◆ GetOnPlayerRemoved()

OnPlayerEventInvoker SCR_BaseScoringSystemComponent::GetOnPlayerRemoved ( )
inlineprotected
Returns
invoker that is invoked when any score changes.

Definition at line 79 of file SCR_BaseScoringSystemComponent.c.

◆ GetOnPlayerScoreChanged()

OnPlayerScoreChangedInvoker SCR_BaseScoringSystemComponent::GetOnPlayerScoreChanged ( )
inlineprotected
Returns
invoker that is invoked when score of provided player changes.

Definition at line 40 of file SCR_BaseScoringSystemComponent.c.

◆ GetPlayerScore()

int SCR_BaseScoringSystemComponent::GetPlayerScore ( int playerId)
inlineprotected
Returns
score for given player by their playerId or 0 if none.

Definition at line 482 of file SCR_BaseScoringSystemComponent.c.

◆ GetPlayerScoreInfo()

SCR_ScoreInfo SCR_BaseScoringSystemComponent::GetPlayerScoreInfo ( int playerId)
inlineprotected
Returns
score info of provided player or null if none.

Definition at line 493 of file SCR_BaseScoringSystemComponent.c.

◆ GetScoreLimit()

int SCR_BaseScoringSystemComponent::GetScoreLimit ( )
inlineprotected
Returns
maximum allowed score or -1 if undefined.

Definition at line 609 of file SCR_BaseScoringSystemComponent.c.

◆ OnDelete()

override void SCR_BaseScoringSystemComponent::OnDelete ( IEntity owner)
inlineprotected

Definition at line 648 of file SCR_BaseScoringSystemComponent.c.

◆ OnFactionScoreChanged()

void SCR_BaseScoringSystemComponent::OnFactionScoreChanged ( Faction faction,
SCR_ScoreInfo scoreInfo )
inlineprotected

Called on all machines when faction score changes.

Parameters
[in]faction
[in]scoreInfo

Definition at line 460 of file SCR_BaseScoringSystemComponent.c.

◆ OnPlayerDisconnected()

override void SCR_BaseScoringSystemComponent::OnPlayerDisconnected ( int playerId,
KickCauseCode cause,
int timeout )
inlineprotected

Definition at line 541 of file SCR_BaseScoringSystemComponent.c.

◆ OnPlayerRegistered()

override void SCR_BaseScoringSystemComponent::OnPlayerRegistered ( int playerId)
inlineprotected

Definition at line 523 of file SCR_BaseScoringSystemComponent.c.

◆ OnPlayerScoreChanged()

void SCR_BaseScoringSystemComponent::OnPlayerScoreChanged ( int playerId,
SCR_ScoreInfo scoreInfo )
inlineprotected

Called on all machines when player score changes.

Parameters
[in]playerId
[in]scoreInfo

Definition at line 446 of file SCR_BaseScoringSystemComponent.c.

◆ OnPostInit()

override void SCR_BaseScoringSystemComponent::OnPostInit ( IEntity owner)
inlineprotected

Definition at line 637 of file SCR_BaseScoringSystemComponent.c.

◆ RplLoad()

override bool SCR_BaseScoringSystemComponent::RplLoad ( ScriptBitReader reader)
inlineprotected

Deserialise state of scoring into buffer via provided reader.

Parameters
[in]reader
Returns

Definition at line 128 of file SCR_BaseScoringSystemComponent.c.

◆ RplSave()

override bool SCR_BaseScoringSystemComponent::RplSave ( ScriptBitWriter writer)
inlineprotected

Serialise current state of scoring into buffer via provided writer.

Parameters
[in]writer
Returns

Definition at line 91 of file SCR_BaseScoringSystemComponent.c.

Member Data Documentation

◆ m_mFactionScores

ref map<Faction, ref SCR_ScoreInfo> SCR_BaseScoringSystemComponent::m_mFactionScores = new map<Faction, ref SCR_ScoreInfo>()
protected

Map of scores per faction.

Definition at line 33 of file SCR_BaseScoringSystemComponent.c.

◆ m_mPlayerScores

ref map<int, ref SCR_ScoreInfo> SCR_BaseScoringSystemComponent::m_mPlayerScores = new map<int, ref SCR_ScoreInfo>()
protected

Map of scores per player. key: playerId

Definition at line 30 of file SCR_BaseScoringSystemComponent.c.

◆ m_OnFactionScoreChangedInvoker

ref OnFactionScoreChangedInvoker SCR_BaseScoringSystemComponent::m_OnFactionScoreChangedInvoker
protected

This invoker is invoked when score of provided faction changes.

Definition at line 49 of file SCR_BaseScoringSystemComponent.c.

◆ m_OnPlayerAdded

ref OnPlayerEventInvoker SCR_BaseScoringSystemComponent::m_OnPlayerAdded
protected

This invoker is invoked when a player is registered to the scoreboard.

Definition at line 62 of file SCR_BaseScoringSystemComponent.c.

◆ m_OnPlayerRemoved

ref OnPlayerEventInvoker SCR_BaseScoringSystemComponent::m_OnPlayerRemoved
protected

This invoker is invoked when a player is registered to the scoreboard.

Definition at line 75 of file SCR_BaseScoringSystemComponent.c.

◆ m_OnPlayerScoreChangedInvoker

ref OnPlayerScoreChangedInvoker SCR_BaseScoringSystemComponent::m_OnPlayerScoreChangedInvoker
protected

This invoker is invoked when score of provided player changes.

Definition at line 36 of file SCR_BaseScoringSystemComponent.c.


The documentation for this class was generated from the following file: