summaryrefslogtreecommitdiff
path: root/ws2015/eip/blaetter/07/H7-1C/de/lmu/tcs/Position.java
blob: 9c98b7797d61c081bfaf65930641a9e50ff46b28 (plain)
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
package de.lmu.tcs;

/**
 * Model
 *
 * Immutable
 *
 * Created by jost on 24.11.15.
 */
public class Position {

    private final int x;
    private final int y;

    public Position(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public int getX() {
        return this.x;
    }

    public int getY() {
        return this.y;
    }

    public Position add(Position r) {
	return new Position(this.x + r.x, this.y + r.y);
    }
}