IndexOf() public method

public IndexOf ( MapTile, t ) : int
t MapTile,
return int
Exemplo n.º 1
0
    MapTile NextTile(MapTile t)
    {
        MapColumn stack = TileColumnAt(t.x, t.y);

        if (stack == null)
        {
            return(null);
        }
        int tidx = stack.IndexOf(t);

        if (tidx == -1)
        {
            return(null);
        }
        if (tidx + 1 >= stack.Count)
        {
            return(null);
        }
/*		Debug.Log("next after "+t+" at "+tidx+" is "+stack.At(tidx+1)+" where count is "+stack.Count);*/
        return(stack.At(tidx + 1));
    }
Exemplo n.º 2
0
    void SetNextTile(MapTile prev, MapTile next)
    {
        int idx = prev.y * (int)_size.x + prev.x;

        if (idx >= stacks.Length)
        {
            return;
        }
        MapColumn stack = stacks[idx];

        if (stack == null)
        {
            return;
        }
        int tidx = stack.IndexOf(prev);

        if (tidx == -1)
        {
            return;
        }
        stack.Insert(tidx, next);
    }