-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroundType.java
More file actions
52 lines (45 loc) · 1.26 KB
/
GroundType.java
File metadata and controls
52 lines (45 loc) · 1.26 KB
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
48
49
50
51
52
package com.sixfootgeek;
import java.awt.*;
/**
* File: GroundType.java
* Version: 0.32476
* Date: 28th February 2015.
* Author: Andy Barlow
*
* Description:
*
* This enum class sets up all the different properties for groundtypes
* # whether passable,
* # the print character for console
* # the colour
*
* then there are access methods for retrieving this data for the map objects later on.
*/
public enum GroundType {
GRASS(',', true, Color.GREEN),
WATER('~', false, Color.BLUE),
DIRT('.', true, Color.RED.darker()),
FENCE('|', false, Color.DARK_GRAY);
//declare the primitives we want
private final char mChar;
private final boolean mPassable;
private final Color mColour;
private GroundType(char printChar, boolean printStatus, Color printColor) {
mChar = printChar;
mPassable = printStatus;
mColour = printColor;
}
//access methods for the enum.
//gets colour
public Color getColour() {
return mColour;
}
//getChar returns the char representation of the enum
public char getChar() {
return mChar;
}
//unused in current implementation of map but useful later on
public Boolean getPassable() {
return mPassable;
}
}