Beispiel #1
0
    bool useOn(AW2DEntity entity = null)
    {
        AW2DAction useOnAction = states[currentState].useOnAction;

        useOnAction.subject = this;
        useOnAction.execute();

        AW2DInteractAction useInteraction = useOnAction as AW2DInteractAction;

        if (useInteraction != null)
        {
            useInteraction.interactionObject = entity;
            useInteraction.execute();
            return(useInteraction.hasInteracted);
        }

        useOnAction.execute();
        return(false);
    }
Beispiel #2
0
    // MARK: - Lifecycle

    AW2DUseAction(AW2DEntity subject)
    {
        this.subject = subject;
    }
    // MARK: - Lifecycle

    AW2DInteractAction(AW2DEntity interactionObject)
    {
        this.interactionObject = interactionObject;
        this.hasInteracted     = false;
    }
 abstract public void interact(AW2DEntity source, AW2DEntity destination);
 abstract public void use(AW2DEntity entity);
 abstract public void pick(AW2DEntity entity);
 abstract public void turnTowards(AW2DEntity entity);
    // MARK: - Abstract methods

    abstract public void moveTo(AW2DEntity entity);