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

import java.awt.Color;
import java.awt.Point;

/**
 *
 * @author hatkirby
 */
public abstract class Mob
{
    public int x;
    public int y;
    public int health;
    public boolean hostile;
    public int power;
    
    public Mob(int x, int y)
    {
        this.x = x;
        this.y = 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();
    public abstract Color getDisplayColor();
    public abstract String getName();
    public abstract String getBattleMessage();
}