package com.bernard.greposimu.model.game;

import java.io.StringWriter;
import java.util.Map;

import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.DumperOptions.FlowStyle;
import org.yaml.snakeyaml.Yaml;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)
public class GameData {
	
	public Map<String,Unit> units;
	
	public Map<String, ? extends JsonPower> powers;
	
	public Map<String, God> gods;
	
	public Map<String, Hero> heroes;
	
	public Map<String, Research> researches;
	
	public Map<String, Building> buildings;
	
	@Override
	public String toString() {
		DumperOptions options = new DumperOptions();
		options.setDefaultFlowStyle(FlowStyle.BLOCK);
		options.setPrettyFlow(true);
		Yaml yaml = new Yaml(options);
		StringWriter writer = new StringWriter();
		yaml.dump(this, writer);
		return writer.toString();
	}
}
