Beispiel #1
0
    /**
     * Set this status checkable with the information from the given protocol
     */
    public void setFromProtocol(StatusCheckableProtocol protocol)
    {
        if (protocol.HasAmount)
        {
            quantity = protocol.Amount;
        }
        else if (protocol.Action.Target.HasAmount)            //because its like this too in more places than I feel like changing
        {
            quantity = protocol.Action.Target.Amount;
        }
        else
        {
            quantity = 1;
        }

        if (protocol.HasNot)
        {
            not = protocol.Not;
        }
        else
        {
            not = false;
        }

        checkAction   = new PlayerAction(protocol.Action);
        currentAmount = 0;

//		Debug.Log ("Built action checkable: " + checkAction.getActionType () + "," + checkAction.getDirectObject ().getIdentifier () + "," + checkAction.getDirectObject ().getTypeIdentifier () + "," + quantity);
    }
Beispiel #2
0
    /**
     * Set this status checkable with the information from the given protocol
     */
    public void setFromProtocol(StatusCheckableProtocol protocol)
    {
        areas = protocol.NumAreas.NumAreas;

        if (protocol.HasNot)
        {
            not = protocol.Not;
        }
        else
        {
            not = false;
        }

//		Debug.Log ("Built Num Areas checkable: " + areas);
    }
Beispiel #3
0
    /**
     * Set this status checkable with the information from the given protocol
     */
    public void setFromProtocol(StatusCheckableProtocol protocol)
    {
        checkTier = protocol.Tier.Tier;

        if (protocol.HasNot)
        {
            not = protocol.Not;
        }
        else
        {
            not = false;
        }

        Debug.Log("Built Tier checkable: " + checkTier);
    }
Beispiel #4
0
    /**
     * Set this status checkable with the information from the given protocol
     */
    public void setFromProtocol(StatusCheckableProtocol protocol)
    {
        checkLevel = protocol.Level.Level;

        if (protocol.HasNot)
        {
            not = protocol.Not;
        }
        else
        {
            not = false;
        }

        Debug.Log("Built Level checkable: " + checkLevel);
    }
Beispiel #5
0
    /**
     * creates and returns a status checkable built from the given protocol
     */
    public StatusCheckable getStatusCheckableFromProtocol(StatusCheckableProtocol protocol)
    {
        if (protocol.HasAction)
        {
            ActionCheckable act = new ActionCheckable();
            act.setFromProtocol(protocol);
            return(act);
        }
        else if (protocol.HasLevel)
        {
            LevelCheckable level = new LevelCheckable();
            level.setFromProtocol(protocol);
            return(level);
        }
        else if (protocol.HasTier)
        {
            TierCheckable tier = new TierCheckable();
            tier.setFromProtocol(protocol);
            return(tier);
        }
        else if (protocol.HasQuest)
        {
            QuestFinishedCheckable quest = new QuestFinishedCheckable();
            quest.setFromProtocol(protocol);
            return(quest);
        }
        else if (protocol.HasNumAreas)
        {
            NumAreasCheckable areas = new NumAreasCheckable();
            areas.setFromProtocol(protocol);
            return(areas);
        }

        MasterDriver.Instance.log("Could not load Status Checkable from protobuf, status type may not be implemented yet.");
        return(null);
    }
Beispiel #6
0
    /**
     * Set this status checkable with the information from the given protocol
     */
    public void setFromProtocol(StatusCheckableProtocol protocol)
    {
        if (protocol.HasAmount)
        {
            quantity = protocol.Amount;
        }
        else
        {
            quantity = 1;
        }

        if (protocol.HasNot)
        {
            not = protocol.Not;
        }
        else
        {
            not = false;
        }

        checkQuest = protocol.Quest.Name;

//		Debug.Log ("Built quest finished checkable: " + checkQuest);
    }