Skip to content

Commit

Permalink
Add a handy subtract method to Coords.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoxon committed Oct 23, 2013
1 parent 2259d61 commit c413666
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/net/bytten/metazelda/util/Coords.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public Coords add(int dx, int dy) {
return new Coords(x + dx, y + dy);
}

public Coords subtract(Coords other) {
return new Coords(x-other.x, y-other.y);
}

@Override
public boolean equals(Object other) {
if (other instanceof Coords) {
Expand Down

0 comments on commit c413666

Please sign in to comment.