예제 #1
0
    //判断该Tile 四个Corner的地形属性是否为Solid
    public bool IsCornerFree(int x, int y, FloatRect.CornerLabel corner)
    {
        switch (corner)
        {
        case FloatRect.CornerLabel.A:
            return(!this.GetTile(x - 1, y).Solid&& !this.GetTile(x - 1, y + 1).Solid&& !this.GetTile(x, y + 1).Solid);

        case FloatRect.CornerLabel.B:
            return(!this.GetTile(x + 1, y).Solid&& !this.GetTile(x + 1, y + 1).Solid&& !this.GetTile(x, y + 1).Solid);

        case FloatRect.CornerLabel.C:
            return(!this.GetTile(x + 1, y).Solid&& !this.GetTile(x + 1, y - 1).Solid&& !this.GetTile(x, y - 1).Solid);

        case FloatRect.CornerLabel.D:
            return(!this.GetTile(x - 1, y).Solid&& !this.GetTile(x - 1, y - 1).Solid&& !this.GetTile(x, y - 1).Solid);

        default:
            return(false);
        }
    }
예제 #2
0
        public Vector2               pos;   //位置

        public Corner(FloatRect.CornerLabel dir, Vector2 pos)
        {
            this.dir = dir;
            this.pos = pos;
        }