Пример #1
0
 // detailed constructor, used in the node.copy() method
 public Node(int index,
             Color32 colorF, Color32 colorW,
             String floorSprite, String wallSprite,
             String[] debris,
             TileType type, /*bool hasSign,*/ String signMessage,
             int[] defaultConn, int[] tempConn, bool[] drawCorner,
             bool hasEnter, bool hasLeave, Direction enter, Direction leave
             )
 {
     this.index       = index;
     this.colorF      = colorF;
     this.colorW      = colorW;
     this.floorSprite = floorSprite;
     this.wallSprite  = wallSprite;
     for (int i = 0; i < 9; i++)
     {
         this.debris[i] = debris[i];
     }
     this.type = type;
     //this.hasSign = hasSign;
     this.signMessage = signMessage;
     for (int i = 0; i < 4; i++)
     {
         this.defaultConn[i] = defaultConn[i];
         this.tempConn[i]    = tempConn[i];
         this.drawCorner[i]  = drawCorner[i];
     }
     this.hasEnter = hasEnter;
     this.hasLeave = hasLeave;
     this.enter    = enter;
     this.leave    = leave;
 }
Пример #2
0
 public LineData(bool hasEnter, bool hasLeave, GameManager.Direction enter, GameManager.Direction leave, bool lineActive)
 {
     this.hasEnter   = hasEnter;
     this.hasLeave   = hasLeave;
     this.enter      = enter;
     this.leave      = leave;
     this.lineActive = lineActive;
 }
Пример #3
0
    public int?GetConnectionFromDir(GameManager.Direction dir)
    {
        switch (dir)
        {
        case GameManager.Direction.North:
            return(connections.north);

        case GameManager.Direction.South:
            return(connections.south);

        case GameManager.Direction.East:
            return(connections.east);

        case GameManager.Direction.West:
            return(connections.west);
        }
        return(null);
    }
Пример #4
0
    public void ShiftGrid(GameManager.Direction direction)
    {
        RenderMap[] maps = new RenderMap[] { renderMap, altRenderMap };
        foreach (RenderMap rM in maps)
        {
            for (int x = 0; x < rM.dim; x++)
            {
                for (int y = 0; y < rM.dim; y++)
                {
                    for (int i = 0; i < 4; i++)
                    {
                        rM[x, y].SetLineFromDir((Direction)i, false);
                    }
                }
            }
            switch (direction)
            {
            case GameManager.Direction.North:
                for (int x = 0; x < rM.dim; x++)
                {
                    for (int y = 0; y < rM.dim - 1; y++)                             // Dont do final row since it doesnt have anything after it
                    {
                        rM[x, y].CopyState(rM[x, y + 1]);
                    }
                }
                //Handle blanking out the last row out
                for (int x = 0; x < rM.dim; x++)
                {
                    rM[x, rM.dim - 1].DrawFullNode(null);
                }
                break;

            case GameManager.Direction.East:
                for (int x = 0; x < rM.dim - 1; x++)
                {
                    for (int y = 0; y < rM.dim; y++)                             // Dont do final row since it doesnt have anything after it
                    {
                        rM[x, y].CopyState(rM[x + 1, y]);
                    }
                }
                //Handle blanking out the last row out
                for (int y = 0; y < rM.dim; y++)
                {
                    rM[rM.dim - 1, y].DrawFullNode(null);
                }
                //Handling blanking the last row out
                break;

            case GameManager.Direction.South:
                for (int x = 0; x < rM.dim; x++)
                {
                    for (int y = rM.dim - 1; y > 0; y--)                             // Dont do final row since it doesnt have anything after it
                    {
                        rM[x, y].CopyState(rM[x, y - 1]);
                    }
                }
                //Handling blanking the last row out
                //Handle blanking out the last row out
                for (int x = 0; x < rM.dim; x++)
                {
                    rM[x, 0].DrawFullNode(null);
                }
                break;

            case GameManager.Direction.West:
                for (int x = rM.dim - 1; x > 0; x--)
                {
                    for (int y = 0; y < rM.dim; y++)                             // Dont do final row since it doesnt have anything after it
                    {
                        rM[x, y].CopyState(rM[x - 1, y]);
                    }
                }
                //Handling blanking the last row out
                for (int y = 0; y < rM.dim; y++)
                {
                    rM[0, y].DrawFullNode(null);
                }
                break;

            default:
                break;
            }
        }
    }