diff --git a/Mage.Common/src/mage/interfaces/ActionWithResult.java b/Mage.Common/src/mage/interfaces/ActionWithResult.java new file mode 100644 index 00000000000..d51a7213ad3 --- /dev/null +++ b/Mage.Common/src/mage/interfaces/ActionWithResult.java @@ -0,0 +1,25 @@ +package mage.interfaces; + +/** + * /** + * Light weight action interface + * For executing actions without any context. + * + * @param Type to return as a result of execution. + * + * @author noxx + */ +public interface ActionWithResult { + + /** + * Executes and returns result. + * @return + */ + public T execute(); + + /** + * Returns negative result specific for type . + * @return + */ + public T negativeResult(); +} diff --git a/Mage.Common/src/mage/utils/ActionWithBooleanResult.java b/Mage.Common/src/mage/utils/ActionWithBooleanResult.java new file mode 100644 index 00000000000..e0acfb23b2c --- /dev/null +++ b/Mage.Common/src/mage/utils/ActionWithBooleanResult.java @@ -0,0 +1,13 @@ +package mage.utils; + +import mage.interfaces.ActionWithResult; + +/** + * @author noxx + */ +public abstract class ActionWithBooleanResult implements ActionWithResult { + @Override + public Boolean negativeResult() { + return false; + } +}