Package uk.co.oliwali.HawkEye.callbacks

Source Code of uk.co.oliwali.HawkEye.callbacks.RollbackCallback

package uk.co.oliwali.HawkEye.callbacks;

import org.bukkit.command.CommandSender;

import uk.co.oliwali.HawkEye.PlayerSession;
import uk.co.oliwali.HawkEye.Rollback;
import uk.co.oliwali.HawkEye.Rollback.RollbackType;
import uk.co.oliwali.HawkEye.database.SearchQuery.SearchError;
import uk.co.oliwali.HawkEye.util.Util;

/**
* Implementation of BaseCallback for use in rollback commands
* @author oliverw92
*/
public class RollbackCallback extends BaseCallback {

  private final PlayerSession session;
  private final CommandSender sender;
  private final RollbackType type;

  public RollbackCallback(PlayerSession session, RollbackType type) {
    this.type = type;
    this.session = session;
    sender = session.getSender();
    Util.sendMessage(sender, "&cSearching for matching results to rollback...");
  }

  @Override
  public void execute() {
    session.setRollbackResults(results);
    new Rollback(type, session);
  }

  @Override
  public void error(SearchError error, String message) {
    Util.sendMessage(session.getSender(), message);
  }

}
TOP

Related Classes of uk.co.oliwali.HawkEye.callbacks.RollbackCallback

TOP
Copyright © 2018 www.massapi.com. 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.