Remove unnecessary utilities (#99)

- Comparable.clamp is already defined
- Boolean class does not exist
- String#start_with? already exists
- String#end_with? already exists
- String#bytesize already exists
- String#capitalize already exists
- Integer#digits already exists
- Array#first and Array#last already exist
- Array#shuffle already exists

Ruby's own Integer#digits returns an array with the least significant digit as the first array element. That means that the method's only usage has to be appended with a call to Array#reverse.
This commit is contained in:
Joni Savolainen
2021-02-26 21:38:27 +02:00
committed by GitHub
parent d6b80118c9
commit 4e43a06f1b
2 changed files with 2 additions and 84 deletions

View File

@@ -191,7 +191,8 @@ class PokemonDataBox < SpriteWrapper
end
def pbDrawNumber(number,btmp,startX,startY,align=0)
n = (number==-1) ? [10] : number.to_i.digits # -1 means draw the / character
# -1 means draw the / character
n = (number == -1) ? [10] : number.to_i.digits.reverse
charWidth = @numbersBitmap.width/11
charHeight = @numbersBitmap.height
startX -= charWidth*n.length if align==1