UnitCollection.java :  » Search » evolutionchamber » com » fray » evo » Java Open Source

Java Open Source » Search » evolutionchamber 
evolutionchamber » com » fray » evo » UnitCollection.java
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.fray.evo;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;

import com.fray.evo.util.Race;
import com.fray.evo.util.RaceLibraries;
import com.fray.evo.util.Unit;
import com.fray.evo.util.ZergUnitLibrary;

/**
 * Deperecated, use BuildableCollection instead
 * 
 * @author Cyrik
 */
@Deprecated
public final class UnitCollection extends BuildableCollection<Unit> implements Serializable {

  public UnitCollection(Collection<Unit> units, Race race) {
    this(units.size(), race);
  }

  public UnitCollection(int size, Race race) {
    super(size, race);
  }

  public HashMap<Unit, Integer> toHashMap() {
    return super.toHashMap(RaceLibraries.getUnitLibrary(race));
  }

  @Override
  public UnitCollection clone() {
    UnitCollection result = new UnitCollection(arr.length, race);
    for (int i = 0; i < arr.length; i++) {
      result.putById(i, arr[i]);
    }
    return result;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.