All Downloads are FREE. Search and download functionalities are using the official Maven repository.

enterprises.orbital.impl.evexmlapi.chr.SkillInfoResponse Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package enterprises.orbital.impl.evexmlapi.chr;

import java.util.HashSet;
import java.util.Set;
import java.util.logging.Logger;

import enterprises.orbital.evexmlapi.chr.ISkill;
import enterprises.orbital.evexmlapi.chr.ISkillInfo;
import enterprises.orbital.impl.evexmlapi.ApiResponse;

public class SkillInfoResponse extends ApiResponse implements ISkillInfo {
  private static final Logger          log    = Logger.getLogger(SkillInfoResponse.class.getName());
  private long                         freeSkillPoints;
  private final Set skills = new HashSet();

  public void setFreeSkillPoints(
                                 long freeSkillPoints) {
    this.freeSkillPoints = freeSkillPoints;
  }

  @Override
  public long getFreeSkillPoints() {
    return freeSkillPoints;
  }

  public void addCollector(
                           CharacterSheetRowsetDataCollector c) {
    // Copy collector objects based on type
    if (c.type.equals("skills")) {
      for (CharacterSheetRowsetData next : c.stuff) {
        ApiCharacterSkill newSkill = new ApiCharacterSkill();
        newSkill.setTypeID(next.getTypeID());
        newSkill.setLevel(next.getLevel());
        newSkill.setSkillpoints(next.getSkillpoints());
        newSkill.setPublished(next.isPublished());
        skills.add(newSkill);
      }
    } else
      log.warning("Ignoring unknown collection type: " + c.type);
  }

  @Override
  public Set getSkills() {
    Set result = new HashSet();
    result.addAll(skills);
    return result;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy