Beispiel #1
0
    //Parsing of BattleNodeContent, helper for getTreeNodeContentFromStr
    private static BattleNodeContent getBattleNodeContentFromStr(string contentStr)
    {
        var            contentList    = ParseHelper.getSplitList(contentStr, ";");
        BattleNodeType battleNodeType = getBattleNodeTypeFromStr(contentList[2]);

        switch (battleNodeType)
        {
        case BattleNodeType.Info:
            return(new BattleNodeContent()
            {
                linkIndex = Int64.Parse(contentList[0]), nodeName = contentList[1], nodeType = battleNodeType, description = contentList[3], icon = contentList[4]
            });

        case BattleNodeType.Enemy:
            return(new BattleNodeContent()
            {
                linkIndex = Int64.Parse(contentList[0]), nodeName = contentList[1], nodeType = battleNodeType, description = contentList[3], icon = contentList[4], x = Int32.Parse(contentList[5]), y = Int32.Parse(contentList[6])
            });

        case BattleNodeType.Loot:
            return(new BattleNodeContent()
            {
                linkIndex = Int64.Parse(contentList[0]), nodeName = contentList[1], nodeType = battleNodeType, description = contentList[3], icon = contentList[4], count = Int32.Parse(contentList[5])
            });

        case BattleNodeType.Win:
            return(new BattleNodeContent()
            {
                linkIndex = Int64.Parse(contentList[0]), nodeName = contentList[1], nodeType = battleNodeType, description = contentList[3], icon = contentList[4]
            });

        default: return(null);
        }
    }
Beispiel #2
0
    public void ChangeNodeType(BattleNodeType _type)
    {
        battleNodeType = _type;

        if (color == "hover")
        {
            return;
        }

        if (battleNodeType == BattleNodeType.empty)
        {
            ChangeBackgoundColor();
        }
        else
        {
            ChangeBackgoundColor("interactable");
        }
    }