Ejemplo n.º 1
0
 public void ReceiveStream(ResourceStream ReceivingStream, IOStreamDir ReceivingDir)
 {
     RemoveFromStream(ReceivingDir);
     Stream    = ReceivingStream;
     animColor = ReceivingStream._streamColor;
     this.ManageStream();
 }
Ejemplo n.º 2
0
    public GridGameObject GetNeighbor(IOStreamDir dirToCheck)
    {
        GridGameObject returnObj = null;

        switch (dirToCheck)
        {
        case IOStreamDir.Top:
            //  bool hasNeighbor = myGrid.hasNeighbor(wPos, hPos + 1);
            if (myGrid.getGridPiece(wPos, hPos - 1) != null)

            {
                if (myGrid.getGridPiece(wPos, hPos - 1).hasGridObject)
                {
                    returnObj = myGrid.getGridPiece(wPos, hPos - 1).GridObj;
                    if (returnObj.StreamInputs.Contains(IOStreamDir.Bottom))
                    {
                    }
                    else
                    {
                        returnObj = null;
                    }
                }
            }
            break;

        case IOStreamDir.Right:
            if (myGrid.getGridPiece(wPos + 1, hPos) != null)
            {
                if (myGrid.getGridPiece(wPos + 1, hPos).hasGridObject)
                {
                    returnObj = myGrid.getGridPiece(wPos + 1, hPos).GridObj;
                    if (returnObj.StreamInputs.Contains(IOStreamDir.Left))
                    {
                    }
                    else
                    {
                        returnObj = null;
                    }
                }
            }
            break;

        case IOStreamDir.Bottom:
            if (myGrid.getGridPiece(wPos, hPos + 1) != null)
            {
                if (myGrid.getGridPiece(wPos, hPos + 1).hasGridObject)
                {
                    returnObj = myGrid.getGridPiece(wPos, hPos + 1).GridObj;
                    if (returnObj.StreamInputs.Contains(IOStreamDir.Top))
                    {
                    }
                    else
                    {
                        returnObj = null;
                    }
                }
            }
            break;

        case IOStreamDir.Left:
            if (myGrid.getGridPiece(wPos - 1, hPos) != null)
            {
                if (myGrid.getGridPiece(wPos - 1, hPos).hasGridObject)
                {
                    returnObj = myGrid.getGridPiece(wPos - 1, hPos).GridObj;
                    if (returnObj.StreamInputs.Contains(IOStreamDir.Right))
                    {
                    }
                    else
                    {
                        returnObj = null;
                    }
                }
            }
            break;

        default:
            Debug.LogError("Cannot currently support passing :" + dirToCheck);
            break;
        }

        return(returnObj);
    }
Ejemplo n.º 3
0
 public void RemoveFromStream(IOStreamDir ReceivingStream)
 {
 }