Package de.justi.yagw2api.wrapper

Examples of de.justi.yagw2api.wrapper.IWVWObjective$IWVWObjectiveBuilder


    checkArgument(mapDTO.getGreenScore() >= 0);
    checkArgument(mapDTO.getObjectives().length == mapModel.getObjectives().size());

    // 1. synchronize objectives
    Optional<IWVWObjective> optionalObjectiveModel;
    IWVWObjective objectiveModel;
    Optional<IWorld> potentialNewOwner;
    Optional<IGuildDetailsDTO> claimedByGuildDTO;
    for (IWVWObjectiveDTO objectiveDTO : mapDTO.getObjectives()) {
      optionalObjectiveModel = mapModel.getByObjectiveId(objectiveDTO.getId());
      if (optionalObjectiveModel.isPresent()) {
        objectiveModel = optionalObjectiveModel.get();
        objectiveModel.updateOnSynchronization();
        if (LOGGER.isTraceEnabled()) {
          LOGGER.trace("Going to synchronize model=" + objectiveModel + " with dto=" + objectiveDTO);
        }

        // 1.1 synchronize owner
        potentialNewOwner = match.getWorldByDTOOwnerString(objectiveDTO.getOwner());
        objectiveModel.capture(potentialNewOwner.orNull());
        // 1.2 synchronize claiming guild
        claimedByGuildDTO = objectiveDTO.getGuildDetails();
        if (claimedByGuildDTO.isPresent()) {
          final IGuild guild = MODEL_FACTORY.getOrCreateGuild(claimedByGuildDTO.get().getId(), claimedByGuildDTO.get().getName(), claimedByGuildDTO.get().getTag());
          objectiveModel.claim(guild);
        } else {
          objectiveModel.claim(null);
        }
      } else {
        LOGGER.error("Missing " + IWVWObjective.class.getSimpleName() + " for objectiveId=" + objectiveDTO.getId());
      }
    }
View Full Code Here


  @Override
  public boolean equals(Object obj) {
    if ((obj == null) || !(obj instanceof IWVWObjective)) {
      return false;
    } else {
      final IWVWObjective objective = (IWVWObjective) obj;
      return Objects.equal(this.getLocation().getObjectiveId().orNull(), objective.getLocation().getObjectiveId().orNull());
    }
  }
View Full Code Here

    @Override
    public IWVWObjective build() {
      checkState(this.location.isPresent());
      checkState(this.map != null);

      final IWVWObjective result = new WVWObjective(this.location.get());
      if (this.map.isPresent()) {
        result.connectWithMap(this.map.get());
      }
      result.initializeOwner(this.owner.orNull());
      result.initializeClaimedByGuild(this.claimedByGuild.orNull());
      return result;
    }
View Full Code Here

TOP

Related Classes of de.justi.yagw2api.wrapper.IWVWObjective$IWVWObjectiveBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.