Exemplo n.º 1
0
    // MARK: - Lifecycle

    public AW2DCharacterBaseState(AW2DEntityPosition position, AW2DAction examineAction, AW2DAction talkToAction, AW2DAction interactWithAction)
    {
        this.position           = position;
        this.examineAction      = examineAction;
        this.talkToAction       = talkToAction;
        this.interactWithAction = interactWithAction;
    }
Exemplo n.º 2
0
    public void talkTo()
    {
        AW2DAction talkToAction = states[currentState].talkToAction;

        talkToAction.subject = this;
        talkToAction.execute();
    }
Exemplo n.º 3
0
    public void interactWith()
    {
        AW2DAction interactWithAction = states[currentState].interactWithAction;

        interactWithAction.subject = this;
        interactWithAction.execute();
    }
Exemplo n.º 4
0
    // MARK: - Actions

    public void examine()
    {
        AW2DAction examineAction = states[currentState].examineAction;

        examineAction.subject = this;
        examineAction.execute();
    }
Exemplo n.º 5
0
    // MARK: - Lifecycle

    public AW2DPassage(AW2DPassageID id, AW2DEnvironmentID envA, AW2DEnvironmentID envB, AW2DAction passageAction = null)
    {
        this.id            = id;
        this.envA          = envA;
        this.envB          = envB;
        this.passageAction = passageAction;
    }
Exemplo n.º 6
0
    void pickUp()
    {
        AW2DAction pickUpAction = states[currentState].pickUpAction;

        pickUpAction.subject = this;
        pickUpAction.execute();
    }
Exemplo n.º 7
0
    // MARK: - Lifecycle

    public AW2DItemBaseState(AW2DEntityPosition position, AW2DAction examineAction, AW2DAction interactWithAction, AW2DAction pickUpAction, AW2DAction useOnAction)
    {
        this.position           = position;
        this.examineAction      = examineAction;
        this.interactWithAction = interactWithAction;
        this.pickUpAction       = pickUpAction;
        this.useOnAction        = useOnAction;
    }
Exemplo n.º 8
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);
    }