Esempio n. 1
0
    public static T NewMonitor <T>(PKG.CatchFish.Stages.Stage s, int cfg_beginTicks = 0) where T : PKG.CatchFish.Stages.StageElement, new()
    {
        var m = new T();

        m.owner = s;
        s.monitors.Add(m);
        m.cfg_beginTicks = cfg_beginTicks;
        m.cfg_endTicks   = s.cfg_endTicks;
        return(m);
    }
Esempio n. 2
0
    public static T NewElement <T>(PKG.CatchFish.Stages.Stage s, int cfg_beginTicks = 0) where T : PKG.CatchFish.Stages.StageElement, new()
    {
        var e = new T();

        e.owner = s;
        s.elements.Add(e);
        e.cfg_beginTicks = cfg_beginTicks;
        e.cfg_endTicks   = s.cfg_endTicks;
        return(e);
    }
Esempio n. 3
0
    public static PKG.CatchFish.Stages.Stage NewStage(PKG.CatchFish.Configs.Config cfg, int cfg_endTicks)
    {
        var s = new PKG.CatchFish.Stages.Stage();

        s.cfg    = cfg;
        s.cfg_id = cfg.stages.dataLen;
        cfg.stages.Add(s);
        s.elements     = new xx.List <PKG.CatchFish.Stages.StageElement>();
        s.monitors     = new xx.List <PKG.CatchFish.Stages.StageElement>();
        s.cfg_endTicks = cfg_endTicks;
        s.ticks        = -1; // 方便前置 ++ 变成 0
        return(s);
    }