Exemplo n.º 1
0
        public BitmapMask GetTileMask(int x, int y)
        {
            BitmapMask mask = BitmapMask.None;

            if (x < 0 || x >= Width || y < 0 || y >= Height)
            {
                return(BitmapMask.None);
            }
            if (y > 0)
            {
                if (Map [x, y - 1].Type == TileType.Air)
                {
                    mask |= BitmapMask.North;
                }
            }
            if (x < Width - 1)
            {
                if (Map [x + 1, y].Type == TileType.Air)
                {
                    mask |= BitmapMask.East;
                }
            }
            if (y < Height - 1)
            {
                if (Map [x, y + 1].Type == TileType.Air)
                {
                    mask |= BitmapMask.South;
                }
            }
            if (x > 0)
            {
                if (Map [x - 1, y].Type == TileType.Air)
                {
                    mask |= BitmapMask.West;
                }
            }
            return(mask);
        }
Exemplo n.º 2
0
 public Tile(TileType type)
 {
     Type = type;
     Mask = BitmapMask.None;
 }