IsPath() public method

public IsPath ( int dir ) : bool
dir int
return bool
 private int test2(Tile tile, int dir1, int dir2, int value)
 {
     if (!tile.IsPath(dir1) || !tile.IsPath(dir2)) return value;
     if (!tile.GetNeighbour(dir1).IsPath(dir2)) return value;
     if (!tile.GetNeighbour(dir2).IsPath(dir1)) return value;
     return 0;
 }
Beispiel #2
0
        private void drawTile(int tx, int ty, Graphics g, Brush brush, Pen pen, Brush variantFontBrush, Brush scrollblockerFontBrush)
        {
            g.FillRectangle(brush, Config.LineSize + bsize(tx),
                            Config.LineSize + bsize(ty), Config.GridSize, Config.GridSize);

            Tile tile = tiles[tx, ty];

            if (pen != null && tile.Filled)
            {
                if (tile.Wide)
                {
                    // cross-section?
                    if (tile.IsPath(Directions.North) && tile.IsPath(Directions.East))
                    {
                        drawWideCross(tx, ty, g, pen);
                    }
                    // east-west?
                    else if (!tile.IsPath(Directions.North))
                    {
                        drawWideEW(tx, ty, g, pen);
                    }
                    // north-south then
                    else
                    {
                        drawWideNS(tx, ty, g, pen);
                    }
                }
                else
                {
                    bool drawn = false;
                    for (int dir = Directions.North; dir <= Directions.West; dir++)
                    {
                        if (tile.IsPath(dir) && tile.GetNeighbour(dir).Wide)
                        {
                            drawAdapter(tx, ty, dir, g, pen);
                            drawn = true;
                            break;
                        }
                    }
                    if (!drawn)
                    {
                        drawNormalCorridor(tx, ty, g, pen);
                    }
                }
            }

            // display scrollblocker
            if (tile.ScrollBlocker != 0)
            {
                g.DrawString(tile.ScrollBlocker.ToString(), getFont(), scrollblockerFontBrush,
                             Config.LineSize + bsize(tx) + Config.WallPadding, Config.LineSize + bsize(ty) + Config.WallPadding + getFont().Size + 1);
            }

            // display variant
            if (variantFontBrush != null && tile.Variant > 0)
            {
                g.DrawString(tile.Variant.ToString(), getFont(), variantFontBrush,
                             Config.LineSize + bsize(tx) + Config.WallPadding, Config.LineSize + bsize(ty) + Config.WallPadding);
            }
        }
Beispiel #3
0
        private void compileTile(FOMap m, Preset p, int tx, int ty)
        {
            Tile tile = tiles[tx, ty];

            if (!tile.Filled)
            {
                compileEmpty(m, p, tx, ty);
            }
            else if (tile.Wide)
            {
                compileWide(m, p, tx, ty);
            }
            else
            {
                bool compilen = false;
                for (int dir = Directions.North; dir <= Directions.West; dir++)
                {
                    if (tile.IsPath(dir) && tile.GetNeighbour(dir).Wide)
                    {
                        compileAdapter(m, p, tx, ty, dir);
                        compilen = true;
                        break;
                    }
                }
                if (!compilen)
                {
                    compileNormalCorridor(m, p, tx, ty);
                }
            }
        }
 private int test2(Tile tile, int dir1, int dir2, int value)
 {
     if (!tile.IsPath(dir1) || !tile.IsPath(dir2))
     {
         return(value);
     }
     if (!tile.GetNeighbour(dir1).IsPath(dir2))
     {
         return(value);
     }
     if (!tile.GetNeighbour(dir2).IsPath(dir1))
     {
         return(value);
     }
     return(0);
 }
 private int test(Tile tile, int dir, int value)
 {
     if (tile.IsPath(dir))
     {
         return(0);
     }
     return(value);
 }
 private int test(Tile tile, int dir, int value)
 {
     if (tile.IsPath(dir)) return 0;
     return value;
 }