Vlek / RuinsAndRiches

Ruins & Riches Ultima Online Server Files
6 stars 0 forks source link

Add utility methods for min/max #142

Open Vlek opened 11 months ago

Vlek commented 11 months ago

Right now, we have some code that looks like this:

int skill_value = Player_swordsmanship_skill

if (Player_swordsmanship_skill < other_skill)
{
    skill_value = other_skill
}

etc...

when, instead, it could just be:

int skill_value = Utility.Max(
    Player_swordsmanship_skill,
    other_skill,
    other_other_skill
)

This way, it's clear what's going on and we don't have to keep reinventing the wheel with all of these conditional statements.

Also would like a min as well that's the opposite of this.