Exemplo n.º 1
0
 public Promise<T> Then(ChainDelegate Chain)
 {
     return _Then(_ => {
         Chain(_payload);
         return default(T);
     });
 }
Exemplo n.º 2
0
    public IEnumerator spawnBorder(GridDevil gridder)
    {
        yield return(new WaitForFixedUpdate());

        ChainDelegate f = o => {
            o.name             = "border";
            o.transform.parent = transform;
            return(true);
        };

        nextSpawnOffset   = gridder.gridBaseLowerLeft;
        nextSpawnOffset.x = nextSpawnOffset.x - 1;
        GameObject border = makeBlock(gridder.grid_height - 1, spawnOffset, borderColor);

        doAcrossChain(f, border);

        nextSpawnOffset.x = nextSpawnOffset.x + 1 + gridder.grid_width;
        border            = makeBlock(gridder.grid_height - 1, spawnOffset, borderColor);
        doAcrossChain(f, border);

        nextSpawnOffset.y = nextSpawnOffset.y - 1;
        border            = makeBlock(11, new Vector3(-1f, 0f, 0f), borderColor);
        doAcrossChain(f, border);

        reset(gridder.grid_height);
        yield return(null);
    }
Exemplo n.º 3
0
 public Promise<T> Catch(ChainDelegate Chain)
 {
     return _Catch(_ => {
         Chain(_payload);
         return default(T);
     });
 }
Exemplo n.º 4
0
    public bool doAcrossChain(ChainDelegate f, GameObject o)
    {
        GameObject last;

        while (o != null)
        {
            last = o;
            o    = getBlockParent(o);
            if (!f(last))
            {
                return(false);
            }
        }
        return(true);
    }