SpoutDev/SpoutAPI — pull request #92 by WalkerCrouse (2012-02-25 04:25:08+00:00)
Title: Configuration refactor - MemoryConfiguration, ConfigurationNode, and relocated some stuff.

Refactor plays out something like this:
* Moved methods into MathHelper
* Moved EmptyNullRepresenter into its own file
* MemoryConfiguration HAS ConfigurationNodes
* Configuration IS-A MemoryConfiguration

New Configuration use case:

```java
package net.windwaker.plugin.configuration;

import java.io.File;
import org.spout.api.util.config.Configuration;
import org.spout.api.util.config.ConfigurationNode;

public class Test extends Configuration {

private final ConfigurationNode foo = new ConfigurationNode("foo.bar", "baz"); // You can declare properties like this now, takes the path and the default value.
private final ConfigurationNode bar = new ConfigurationNode("bar.baz", "qux");
private final ConfigurationNode cake = new ConfigurationNode("can.i.haz.cake", "lie");
private final ConfigurationNode bing = new ConfigurationNode("bing.bop", false);

public Test() {
super(new File("plugins/test.yml"));
}

@Override
public void load() {
super.load();
this.addNode(foo); // You can add nodes via instance...
this.addNode("walker.is.cool", true); // ...via key-value
this.addNodes(bar, cake); // ...multiple
this.addNode(this.getNode("i.eat.babies", true));
bing.setConfiguration(this); // save nodes with setConfiguration() in node instance or addNode() in config instance
System.out.println(foo.getPath()); // out: foo.bar
System.out.println(foo.getString()); // out: baz
System.out.println(foo.getValue()); // out: baz
this.save();
}
}
```java

Signed-off-by: WalkerCrouse (Windwaker)