package gizmoball.game;

import gizmoball.NotImplementedException;

/**
 * A trigger triggered by a collision with a "source" gizmo. Whenever
 * the source gizmo is triggered, the trigger is fired, triggering
 * the target gizmo.
 *
 * @specfield source : AbstractGizmo // the gizmo that triggers this
 * trigger
 * @specfield target : AbstractGizmo // the gizmo triggered by this
 * trigger
 *
 * @author <a href="mailto:drkp@mit.edu">Dan R. K. Ports</a>
 * @version $Id: CollisionTrigger.java,v 1.4 2004/04/24 16:37:38 dan Exp $
 */
public class CollisionTrigger extends AbstractTrigger {

    private AbstractGizmo source;
    
    /**
     * Creates a new <code>CollisionTrigger</code> instance with the
     * specified source and target gizmos
     *
     * @param source the <code>AbstractGizmo</code> that triggers
     * this trigger
     * @param target the <code>AbstractGizmo</code> to be triggered
     * by this trigger
     * @effects constructs this
     */
    public CollisionTrigger(AbstractGizmo source, AbstractGizmo target) {
        super(target);
        this.source = source;
    } // CollisionTrigger constructor
    
    /**
     * Gets the value of source
     *
     * @return the value of source
     */
    public AbstractGizmo getSource()  {
        return this.source;
    }

    /**
     * Sets the value of source
     *
     * @param argSource Value to assign to this.source
     */
    public void setSource(AbstractGizmo argSource) {
        this.source = argSource;
    }
    
} // CollisionTrigger
