public ScoreAndDescriptionPair ScoreAndDescriptionForType(ScoreIncrementType type) { switch (type) { case ScoreIncrementType.PushWall: return(PushWallScorePair); case ScoreIncrementType.KillPlayerByBomb: return(KillPlayerByBombScorePair); case ScoreIncrementType.KillPlayerByCrush: return(KillPlayerByCrushScorePair); case ScoreIncrementType.KillPlayerByPush: return(KillPlayerByPushScorePair); case ScoreIncrementType.NearMiss: return(NearMissScorePair); case ScoreIncrementType.WinBonus: return(WinBonusScorePair); case ScoreIncrementType.LifeBonus: return(LivesBonusScorePair); case ScoreIncrementType.TimeBonus: return(TimeScorePair); default: return(new ScoreAndDescriptionPair(0, "No description provided for this type")); } }
public void IncrementScoreForTeamAndType(Team team, ScoreIncrementType type, int multiplier = 1) { ScoreAndDescriptionPair scorePair = ScoreAndDescriptionForType(type); ScoreAndDescriptionPair newScorePair = new ScoreAndDescriptionPair(scorePair.score * multiplier, scorePair.description); IncrementScoreForTeam(newScorePair.score, team); if (ShouldEmitScoreForType(type)) { EmitScoreAndDescriptionForTeam(newScorePair, team); EmphasizeScoreTextForTeam(team); } }
private bool ShouldEmitScoreForType(ScoreIncrementType type) { switch (type) { case ScoreIncrementType.PushWall: case ScoreIncrementType.KillPlayerByBomb: case ScoreIncrementType.KillPlayerByCrush: case ScoreIncrementType.KillPlayerByPush: case ScoreIncrementType.NearMiss: return(true); case ScoreIncrementType.WinBonus: case ScoreIncrementType.LifeBonus: case ScoreIncrementType.TimeBonus: return(false); default: return(false); } }