// Path: core/src/com/galvarez/ttw/utils/Colors.java
// public final class Colors {
// 
//   private Colors() {
//   }
// 
//   /**
//    * Compute the most contrasting black or white color.
//    * 
//    * @see http://www.w3.org/TR/AERT#color-contrast
//    * @see http://24ways.org/2010/calculating-color-contrast/
//    * @see http://en.wikipedia.org/wiki/YIQ
//    */
//   @SuppressWarnings("javadoc")
//   public static Color contrast(Color c) {
//     float yiq = ((c.r * 256 * 299f) + (c.g * 256 * 587f) + (c.b * 256 * 114f)) / 1000f;
//     return (yiq >= 128f) ? Color.BLACK : Color.WHITE;
// 
//   }
// 
//   public static String markup(Entity empire) {
//     return markup(empire.getComponent(Empire.class).color);
//   }
// 
//   public static String markup(Color c) {
//     return "[#" + c.toString().toUpperCase() + "]";
//   }
// 
// }


import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import com.artemis.Component;
import com.badlogic.gdx.graphics.Color;
import com.galvarez.ttw.utils.Colors;
package com.galvarez.ttw.model.data;



/**
 * Represent an empire (and a player) in the game.
 * <p>
 * It can be used as a key in a {@link Map}.
 * 
 * @author Guillaume Alvarez
 */
public final class Empire extends Component {

  private static final AtomicInteger COUNTER = new AtomicInteger(0);

  public final int id;

  public final Color color;

  public final Color backColor;

  public final Culture culture;

  private final boolean computer;

  public Empire(Color color, Culture culture, boolean computer) {
    this.id = COUNTER.getAndIncrement();
    this.color = color;
// Path: core/src/com/galvarez/ttw/utils/Colors.java
// public final class Colors {
// 
//   private Colors() {
//   }
// 
//   /**
//    * Compute the most contrasting black or white color.
//    * 
//    * @see http://www.w3.org/TR/AERT#color-contrast
//    * @see http://24ways.org/2010/calculating-color-contrast/
//    * @see http://en.wikipedia.org/wiki/YIQ
//    */
//   @SuppressWarnings("javadoc")
//   public static Color contrast(Color c) {
//     float yiq = ((c.r * 256 * 299f) + (c.g * 256 * 587f) + (c.b * 256 * 114f)) / 1000f;
//     return (yiq >= 128f) ? Color.BLACK : Color.WHITE;
// 
//   }
// 
//   public static String markup(Entity empire) {
//     return markup(empire.getComponent(Empire.class).color);
//   }
// 
//   public static String markup(Color c) {
//     return "[#" + c.toString().toUpperCase() + "]";
//   }
// 
// }


// Path: core/src/com/galvarez/ttw/model/data/Empire.java
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import com.artemis.Component;
import com.badlogic.gdx.graphics.Color;
import com.galvarez.ttw.utils.Colors;

package com.galvarez.ttw.model.data;



/**
 * Represent an empire (and a player) in the game.
 * <p>
 * It can be used as a key in a {@link Map}.
 * 
 * @author Guillaume Alvarez
 */
public final class Empire extends Component {

  private static final AtomicInteger COUNTER = new AtomicInteger(0);

  public final int id;

  public final Color color;

  public final Color backColor;

  public final Culture culture;

  private final boolean computer;

  public Empire(Color color, Culture culture, boolean computer) {
    this.id = COUNTER.getAndIncrement();
    this.color = color;
    this.backColor = Colors.contrast(color);