-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGfxTile.java
More file actions
44 lines (34 loc) · 1.34 KB
/
Copy pathGfxTile.java
File metadata and controls
44 lines (34 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package lmr.msd.models;
import java.util.Objects;
public final class GfxTile {
public static final GfxTile EMPTY = new GfxTile();
public final short gfxIdx;
public final GfxTileBlendMode blendMode;
public final boolean flipHorizontal; // TODO: determine if this is unclear after testing all flip + rotation combos
public final byte rotations;
public GfxTile() { this(0, GfxTileBlendMode.EMPTY, false, 0); }
public GfxTile(int gfxIdx) {
this(gfxIdx, GfxTileBlendMode.NORMAL, false, 0);
}
public GfxTile(int gfxIdx, GfxTileBlendMode blendMode) { this(gfxIdx, blendMode, false, 0); }
public GfxTile(int gfxIdx, GfxTileBlendMode blendMode, boolean flipHorizontal, int rotations) {
this.gfxIdx = (short) gfxIdx;
this.blendMode = blendMode;
this.flipHorizontal = flipHorizontal;
this.rotations = (byte) rotations;
}
public GfxTile(GfxTile tile) {
this(tile.gfxIdx, tile.blendMode, tile.flipHorizontal, tile.rotations);
}
public boolean equals(GfxTile t) {
return (
gfxIdx == t.gfxIdx
&& blendMode == t.blendMode
&& flipHorizontal == t.flipHorizontal
&& rotations == t.rotations
);
}
public int hashCode() {
return Objects.hash(gfxIdx, blendMode, flipHorizontal, rotations);
}
}