Exemplo n.º 1
0
    EnemySetData GetEnemySet(TextCovertedData data)
    {
        var db     = SaveDataController.Instance.GetDB_static <EnemySetDB>();
        var dbdata = db.GetDataList().Where(x => x._Data._serchId == data._data).First() as EnemySetDBData;

        return(dbdata._enemySetData);
    }
Exemplo n.º 2
0
 public BranchCode(TextCovertedData data)
 {
     _selectList = GetSelectList(data);
     _nextCodes  = new Queue <CodeData> [_selectList.Count];
     for (int i = 0; i < _nextCodes.Length; i++)
     {
         _nextCodes[i] = new Queue <CodeData>();
     }
 }
Exemplo n.º 3
0
    List <string> GetSelectList(TextCovertedData data)
    {
        var result = new List <string>();
        var codes  = data._text.Split('\n');

        foreach (var code in codes)
        {
            result.Add(code);
        }
        return(result);
    }
Exemplo n.º 4
0
 public LoadCode(TextCovertedData data)
 {
     if (data._data == "black")
     {
         toBlack = true;
     }
     else if (data._data == "clear")
     {
         toBlack = false;
     }
 }
Exemplo n.º 5
0
 public AudioCode(TextCovertedData data)
 {
     if (data._data == "reset")
     {
         _reset = true;
     }
     else
     {
         _soundeKey  = data._data;
         _soundIndex = int.Parse(data._text);
     }
 }
Exemplo n.º 6
0
    public ShopCode(TextCovertedData data)
    {
        var db = SaveDataController.Instance.GetDB_static <ShopDB>()._dataList;

        try
        {
            myShopData = db.Where(x => x._serchId == data._data).First();
        }catch (System.NullReferenceException e)
        {
            Debug.LogError($"shop name is not exist:key={data._data}\n{e}");
        }
    }
Exemplo n.º 7
0
    public SkillCode(TextCovertedData data)
    {
        var input     = data._data.Split(',');
        var playerId  = input[0];
        var skillid   = input[1];
        var db_player = SaveDataController.Instance.GetDB_var <PlayerDB, SavedDBData_player>();

        targetPlayer = db_player.Where(x => x._serchId == playerId).First();
        var db_skill = SaveDataController.Instance.GetDB_static <SkillDB>()._dataList;

        targetSkill = db_skill.Where(x => x._serchId == skillid).First();
    }
Exemplo n.º 8
0
    Dictionary <string, int> SetItemSet(TextCovertedData data)
    {
        var result = new Dictionary <string, int>();
        var texts  = data._text.Split('\n');

        result.Add(data._data, int.Parse(texts[0]));
        for (int i = 1; i < texts.Length; i++)
        {
            var text = texts[i].Split(' ');
            try
            {
                result.Add(text[0], int.Parse(text[1]));
            }catch (System.IndexOutOfRangeException)
            {
            }
        }

        return(result);
    }
Exemplo n.º 9
0
 public ImageCode(TextCovertedData data)
 {
     if (data._data == "reset")
     {
         reset     = true;
         _imagePos = GetImagePos(data._text.Trim());
     }
     else
     {
         var d = data._data.Split(',');
         setName = d[0];
         number  = int.Parse(d[1]);
         var text = data._text.Split(' ');
         _imagePos = GetImagePos(text[0].Trim());
         if (text.Length >= 2)
         {
             _imageDirection = GetImageDir(text[1].Trim());
         }
     }
 }
Exemplo n.º 10
0
    public override bool CheckChain(TextCovertedData data)
    {
        if (string.IsNullOrEmpty(data._head))
        {
            return(false);
        }
        var head = data._head.Substring(0, 1);

        if (int.TryParse(head, out int select))
        {
            var newData = new TextCovertedData(data._head.Substring(1), data._data, data._text);
            var next    = new EndCode().CreateCodeData(newData, this._targetScr);
            if (!_nextCodes[select - 1].Contains(next))
            {
                _nextCodes[select - 1].Enqueue(next);
            }
            return(true);
        }
        return(false);
    }
Exemplo n.º 11
0
 public BattleCode(TextCovertedData data)
 {
     _targetEnemySet = GetEnemySet(data);
 }
Exemplo n.º 12
0
 public override bool CheckChain(TextCovertedData data)
 {
     return(false);
 }
Exemplo n.º 13
0
 public WaitCode(TextCovertedData data)
 {
     waitTime = int.Parse(data._data) / 100f;
 }
Exemplo n.º 14
0
 public ItemCode(TextCovertedData data)
 {
     _itemSet = SetItemSet(data);
 }
Exemplo n.º 15
0
 public MapCode(TextCovertedData data)
 {
     mapName = data._data;
 }
Exemplo n.º 16
0
 public FlagCode(TextCovertedData data)
 {
     _flagData = GetFlag(data);
 }
Exemplo n.º 17
0
    public CodeData CreateCodeData(TextCovertedData data, EventCodeScriptable scr)
    {
        if (data == null)
        {
            return(new EndCode());
        }
        if (CheckChain(data))
        {
            return(this);
        }
        CodeData result = null;

        switch (data._head)
        {
        case "":
        case "name":    //name[name]
            result = new TextData(data);
            break;

        case "branch":    //branch \nbranchName \n $#1...
            result = new BranchCode(data);
            break;

        case "flag":    //flag[flagName] 5
            result = new FlagCode(data);
            break;

        case "item":    //item[itemName] 1
            result = new ItemCode(data);
            break;

        case "map":    //map[mapName]
            result = new MapCode(data);
            break;

        case "image":    //image[setName,num] back (center)
            result = new ImageCode(data);
            break;

        case "music":    //music[setName,0]
            result = new AudioCode(data);
            break;

        case "battle":    //battle[enemySetName]
            result = new BattleCode(data);
            break;

        case "load":    //load[black] 500
            result = new LoadCode(data);
            break;

        case "wait":    //wait[500]
            result = new WaitCode(data);
            break;

        default:
            return(null);
        }
        result._targetScr = scr;
        return(result);
    }
Exemplo n.º 18
0
 //次のデータが吸収できるデータなら吸収する
 public virtual bool CheckChain(TextCovertedData data)
 {
     return(false);
 }