about summary refs log tree commit diff stats
path: root/src/com/fourisland/frigidearth/Mob.java
blob: c07e039f9cafaee775153f065ef586ca944b28f7 (plain) (blame)
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
45
46
47
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.fourisland.frigidearth;

import java.awt.Point;

/**
 *
 * @author hatkirby
 */
public abstract class Mob
{
    private int x;
    private int y;
    
    public Mob(int x, int y)
    {
        this.x = x;
        this.y = y;
    }
    
    public int getX()
    {
        return x;
    }
    
    public int getY()
    {
        return y;
    }
    
    public Point getPosition()
    {
        return new Point(x,y);
    }
    
    public void moveInDirection(Direction dir)
    {
        Point to = dir.to(getPosition());
        x = to.x;
        y = to.y;
    }
    
    public abstract char getDisplayCharacter();
}