package com.bernard.greposimu.model.game;

import java.util.Map;

public class Power extends JsonPower {
    public String effect;
    public String name;
    public String description;
    
    @SuppressWarnings("unchecked")
	public Power(JsonPower power, String type) {
		this.effect = (power.effect instanceof String)?(String)power.effect:((Map<String,Map<String,String>>)power.effect).get("type").get(type);
		this.lifetime = power.lifetime;
		this.id = power.id+"."+type;
		this.name = (power.name instanceof String)?(String)power.name:((Map<String,Map<String,String>>)power.name).get("type").get(type);
		this.description = (power.description instanceof String)?(String)power.description:((Map<String,Map<String,String>>)power.description).get("type").get(type);
		this.short_effect = power.short_effect;
		this.favor = power.favor;
		this.fury_percentage_cost = power.fury_percentage_cost;
		this.god_id = power.god_id;
		this.temple_level_sum_dependency = power.temple_level_sum_dependency;
		this.targets = power.targets;
		this.only_own_towns = power.only_own_towns;
		this.boost = power.boost;
		this.is_fake_power = power.is_fake_power;
		this.area_of_effect = power.area_of_effect;
		this.destructive = power.destructive;
		this.negative = power.negative;
		this.extendible = power.extendible;
		this.power_group = power.power_group;
		this.power_group_level = power.power_group_level;
		this.seeds_to = power.seeds_to;
		this.images = power.images;
		this.effects = power.effects;
		this.is_valid_for_happenings = power.is_valid_for_happenings;
		this.meta_fields = power.meta_fields;
		this.meta_defaults = power.meta_defaults;
		this.removed_on_target_loss = power.removed_on_target_loss;
		this.needs_level = power.needs_level;
		this.requires_god = power.requires_god;
		this.ignores_democritus = power.ignores_democritus;
		this.display_amount = power.display_amount;
		this.wasteable = power.wasteable;
		this.is_ritual = power.is_ritual;
		this.recreate_on_restart = power.recreate_on_restart;
		this.transfer_to_casual_world = power.transfer_to_casual_world;
		this.is_onetime_power = power.is_onetime_power;
		this.is_upgradable = power.is_upgradable;
		this.is_capped = power.is_capped;
		this.compatible_powers = power.compatible_powers;
		this.no_lifetime = power.no_lifetime;
		this.passive = power.passive;
	}
    public Power(JsonPower power) {
		this.effect = (String) power.effect;
		this.lifetime = power.lifetime;
		this.id = power.id;
		this.name = (String) power.name;
		this.description = (String) power.description;
		this.short_effect = power.short_effect;
		this.favor = power.favor;
		this.fury_percentage_cost = power.fury_percentage_cost;
		this.god_id = power.god_id;
		this.temple_level_sum_dependency = power.temple_level_sum_dependency;
		this.targets = power.targets;
		this.only_own_towns = power.only_own_towns;
		this.boost = power.boost;
		this.is_fake_power = power.is_fake_power;
		this.area_of_effect = power.area_of_effect;
		this.destructive = power.destructive;
		this.negative = power.negative;
		this.extendible = power.extendible;
		this.power_group = power.power_group;
		this.power_group_level = power.power_group_level;
		this.seeds_to = power.seeds_to;
		this.images = power.images;
		this.effects = power.effects;
		this.is_valid_for_happenings = power.is_valid_for_happenings;
		this.meta_fields = power.meta_fields;
		this.meta_defaults = power.meta_defaults;
		this.removed_on_target_loss = power.removed_on_target_loss;
		this.needs_level = power.needs_level;
		this.requires_god = power.requires_god;
		this.ignores_democritus = power.ignores_democritus;
		this.display_amount = power.display_amount;
		this.wasteable = power.wasteable;
		this.is_ritual = power.is_ritual;
		this.recreate_on_restart = power.recreate_on_restart;
		this.transfer_to_casual_world = power.transfer_to_casual_world;
		this.is_onetime_power = power.is_onetime_power;
		this.is_upgradable = power.is_upgradable;
		this.is_capped = power.is_capped;
		this.compatible_powers = power.compatible_powers;
		this.no_lifetime = power.no_lifetime;
		this.passive = power.passive;
	}
    

	public String getEffect() {
		return effect;
	}

	public void setEffect(String effect) {
		this.effect = effect;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
    
    
    
    
}
