Add components package with interfaces [likely to be moved around soon].

This commit is contained in:
asofold 2012-11-02 10:26:42 +01:00
parent ea82a57272
commit c6eb573b57
6 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,18 @@
package fr.neatmonster.nocheatplus.components;
public interface IComponentRegistry {
/**
* Convenience method to add components according to implemented interfaces,
* like Listener, INotifyReload, INeedConfig.<br>
* For the NoCheatPlus instance this must be done after the configuration has been initialized.
* @param obj
*/
public void addComponent(final Object onj);
/**
* Remove a registered component. <br>
* Does not unregister listeners currently.
* @param obj
*/
public void removeComponent(final Object obj);
}

View File

@ -0,0 +1,10 @@
package fr.neatmonster.nocheatplus.components;
/**
* Some (player-related) data is held here.
* @author mc_dev
*
*/
public interface IData {
}

View File

@ -0,0 +1,12 @@
package fr.neatmonster.nocheatplus.components;
import fr.neatmonster.nocheatplus.checks.CheckType;
/**
* Interface to indicate a component is associated with a CheckType.
* @author mc_dev
*
*/
public interface IHaveCheckType {
public CheckType getCheckType();
}

View File

@ -0,0 +1,11 @@
package fr.neatmonster.nocheatplus.components;
import fr.neatmonster.nocheatplus.command.INotifyReload;
/**
* Indicate that a component needs config after time of creation but in onEnable.
* @author mc_dev
*
*/
public interface INeedConfig extends INotifyReload{
}

View File

@ -0,0 +1,20 @@
package fr.neatmonster.nocheatplus.components;
/**
* Interface for component registration to allow cleanup for player data.
* @author mc_dev
*
*/
public interface IRemoveData {
/**
* Remove the data of one player.
* @param playerName
* @return IData instance, if it was present.
*/
public IData removeData(String playerName);
/**
* Remove the data of all players.
*/
public void removeAllData();
}

View File

@ -0,0 +1,10 @@
package fr.neatmonster.nocheatplus.components;
public interface NoCheatPlusAPI extends IComponentRegistry{
}