示例#1
0
    public SplitEventEditor(IEventVar <T> block, IEnumerable <string> work, IEnumerable <string> flag)
    {
        Block = block;
        // load lines
        var workLines = work.Where(z => !string.IsNullOrWhiteSpace(z) && z.Length > 5);

        Work = EventWorkUtil.GetVars(workLines, (index, t, data) => new EventWork <T>(index, t, data));
        var flagLines = flag.Where(z => !string.IsNullOrWhiteSpace(z) && z.Length > 5);

        Flag = EventWorkUtil.GetVars(flagLines, (index, t, data) => new EventFlag(index, t, data));

        // initialize lines
        foreach (var group in Work)
        {
            foreach (var item in group.Vars)
            {
                item.RawIndex = block.GetWorkRawIndex(item.Type, item.RelativeIndex);
                ((EventWork <T>)item).Value = block.GetWork(item.RawIndex);
            }
        }
        foreach (var group in Flag)
        {
            foreach (var item in group.Vars)
            {
                item.RawIndex          = block.GetFlagRawIndex(item.Type, item.RelativeIndex);
                ((EventFlag)item).Flag = block.GetFlag(item.RawIndex);
            }
        }
    }
示例#2
0
 private void ChangeConstantIndex(object sender, EventArgs e)
 {
     NUD_Stat.Value = SAV.GetWork(CB_Stats.SelectedIndex);
 }