DREAMFIRE Docs ← Back to site
Loading...
Searching...
No Matches
SlotPos.java
Go to the documentation of this file.
1package com.dreamfirestudios.dreamcore.DreamSmartInvs.content;
2
3public class SlotPos {
4
5 private final int row;
6 private final int column;
7
8 public SlotPos(int row, int column) {
9 this.row = row;
10 this.column = column;
11 }
12
13 @Override
14 public boolean equals(Object obj) {
15 if(this == obj)
16 return true;
17 if(obj == null || getClass() != obj.getClass())
18 return false;
19
20 SlotPos slotPos = (SlotPos) obj;
21
22 return row == slotPos.row && column == slotPos.column;
23 }
24
25 @Override
26 public int hashCode() {
27 int result = row;
28 result = 31 * result + column;
29
30 return result;
31 }
32
33 public int getRow() { return row; }
34 public int getColumn() { return column; }
35
36 public static SlotPos of(int row, int column) {
37 return new SlotPos(row, column);
38 }
39
40}