package com.github.niwaniwa.we.core.config;

import java.io.File;

import com.github.niwaniwa.we.core.WhiteEggCore;

public class WhiteEggCoreConfig extends WhiteConfig {

	private boolean lock;
	private boolean useDataBase;
	private boolean useTwitter;
	private boolean savePlayerData;
	private boolean disableListener;

	public WhiteEggCoreConfig() {
		super(WhiteEggCore.getInstance().getDataFolder(), "config.yml");
	}

	public void reload(){
		File file = new File(path, name);
		if(!file.exists()){
			WhiteEggCore.getInstance().saveDefaultConfig();
		}
		load();
		lock = yaml.getBoolean("lock", false);
		useDataBase = yaml.getBoolean("useDataBase", false);
		useTwitter = yaml.getBoolean("useTwitter", true);
		savePlayerData = yaml.getBoolean("savePlayerData", true);
		disableListener = yaml.getBoolean("disableListener", false);
	}

	public void set(String key, Object value){
		yaml.set(key, value);
	}

	public boolean isLock(){
		return lock;
	}

	public boolean useDataBase(){
		return useDataBase;
	}

	public boolean useTwitter(){
		return useTwitter;
	}

	public boolean savePlayerData(){
		return savePlayerData;
	}

	public boolean isDisableListener(){
		return disableListener;
	}

}

@@ -188,16 +188,17 @@
 n lock;%0A
+%0A
 %09private
@@ -202,123 +202,52 @@
 ate 
-boolean useDataBase;%0A%09private boolean useTwitter;%0A%09private boolean savePlayerData;%0A%09private boolean disableListener
+static final String settingPath = %22setting.%22
 ;%0A%0A%09
@@ -538,238 +538,8 @@
 e);%0A
-%09%09useDataBase = yaml.getBoolean(%22useDataBase%22, false);%0A%09%09useTwitter = yaml.getBoolean(%22useTwitter%22, true);%0A%09%09savePlayerData = yaml.getBoolean(%22savePlayerData%22, true);%0A%09%09disableListener = yaml.getBoolean(%22disableListener%22, false);%0A
 %09%7D%0A%0A
@@ -695,27 +695,71 @@
 %09return 
-useDataBa
+yaml.getBoolean(settingPath + %22database.enable%22, fal
 se
+)
 ;%0A%09%7D%0A%0A%09p
@@ -795,16 +795,55 @@
 %09return 
+yaml.getBoolean(settingPath + %22twitter.
 useTwitt
@@ -844,16 +844,24 @@
 eTwitter
+%22, true)
 ;%0A%09%7D%0A%0A%09p
@@ -901,16 +901,54 @@
 %09return 
+yaml.getBoolean(settingPath + %22player.
 savePlay
@@ -953,16 +953,24 @@
 ayerData
+%22, true)
 ;%0A%09%7D%0A%0A%09p
@@ -989,51 +989,294 @@
 n is
-DisableListener()%7B%0A%09%09return disableListener
+EnableCommand()%7B%0A%09%09return yaml.getBoolean(settingPath + %22enableCommands%22, true);%0A%09%7D%0A%0A%09public boolean isEnableListener()%7B%0A%09%09return yaml.getBoolean(settingPath + %22enableListener%22, true);%0A%09%7D%0A%0A%09public boolean isEnableScript() %7B%0A%09%09return yaml.getBoolean(settingPath + %22script.enable%22, false)
 ;%0A%09%7D

Change get mthod