-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfiguration.java
64 lines (53 loc) · 1.55 KB
/
Configuration.java
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
53
54
55
56
57
58
59
60
61
62
63
64
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.arl.chips.conf;
import com.arl.chips.components.Tile;
import com.arl.chips.utils.TileUtils;
/**
*
* @author VKGautam
*/
public class Configuration {
public OptionsCHIPS options;
private Configuration() {
options = new OptionsCHIPS();
LoadDefaults(options);
}
/**
* This will load all the default values:
*
* @param options
*/
private void LoadDefaults(OptionsCHIPS options) {
options.setROW_DEFAULT(4);
options.setCOL_DEFAULT(6);
}
public static Configuration getInstance() {
return ConfigurationHolder.INSTANCE;
}
private static class ConfigurationHolder {
private static final Configuration INSTANCE = new Configuration();
}
public static void main(String[] args) {
Configuration conf = Configuration.getInstance();
TileUtils tu = TileUtils.getInstance();
System.out.println("GRID: " + conf.options.getGrid());
//
// XOR Table
//================
// 0 XOR 0 = 0 0
// 1 XOR 1 = 0 0
// 0 XOR 1 = 1 1
// 1 XOR 0 = 1 1
//
// North, East, South, West
Tile tile = new Tile();
tile = tu.getTile(1, 1, 1, 0);
tu.PrintTile(tile);
tile = tu.getMatchingTile(1, 0);
tu.PrintTile(tile);
}
}