Package com.massivecraft.factions

Source Code of com.massivecraft.factions.FactionEqualsPredictate

package com.massivecraft.factions;

import java.io.Serializable;

import org.bukkit.command.CommandSender;

import com.massivecraft.factions.entity.UPlayer;
import com.massivecraft.factions.entity.Faction;
import com.massivecraft.mcore.Predictate;

public class FactionEqualsPredictate implements Predictate<CommandSender>, Serializable
{
  private static final long serialVersionUID = 1L;
 
  // -------------------------------------------- //
  // FIELDS
  // -------------------------------------------- //
 
  private final String factionId;
  public String getFactionId() { return this.factionId; }
 
  // -------------------------------------------- //
  // CONSTRUCT
  // -------------------------------------------- //
 
  public FactionEqualsPredictate(Faction faction)
  {
    this.factionId = faction.getId();
  }
 
  // -------------------------------------------- //
  // OVERRIDE
  // -------------------------------------------- //
 
  @Override
  public boolean apply(CommandSender sender)
  {
    UPlayer uplayer = UPlayer.get(sender);
    return this.factionId.equals(uplayer.getFactionId());
  }

}
TOP

Related Classes of com.massivecraft.factions.FactionEqualsPredictate

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.