Passed
Push — main ( 06eb13...1446ae )
by Etienne
01:33
created

drawRectangle(MatrixStack,int,int,int,int,int)   A

Complexity

Conditions 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 12
rs 10
1
package de.kleiner3.lasertag.common.util;
2
3
import net.minecraft.client.gui.DrawableHelper;
4
import net.minecraft.client.util.math.MatrixStack;
5
6
/**
7
 * Helper class extending the base drawing functionality of Minecraft's DrawableHelper
8
 *
9
 * @author Étienne Muser
10
 */
11
public abstract class AdvancedDrawableHelper extends DrawableHelper {
12
    /**
13
     * Draw a non-filled rectangle on the matrix stack
14
     * @param matrices The matrix stack
15
     * @param startX The x-coordinate where to start the rectangle
16
     * @param startY The y-coordinate where to start the rectangle
17
     * @param endX The x-coordinate where to end the rectangle
18
     * @param endY The y-coordinate where to end the rectangle
19
     * @param color The color of the rectangle
20
     */
21
    protected void drawRectangle(MatrixStack matrices, int startX, int startY, int endX, int endY, int color) {
22
        // Draw the left line
23
        drawVerticalLine(matrices, startX, startY - 1, endY, color);
24
25
        // Draw the top line
26
        drawHorizontalLine(matrices, startX + 1, endX, startY, color);
27
28
        // Draw the right line
29
        drawVerticalLine(matrices, endX, startY, endY + 1, color);
30
31
        // Draw the bottom line
32
        drawHorizontalLine(matrices, startX, endX - 1, endY, color);
33
    }
34
}
35