Exemplo n.º 1
0
        public cShapeOutline[] GetWallShapes(ref cMaze mMaze, Point pPosition, ref cOrientation oPlayerOrientation)
        {
            List<cShapeOutline> solWallShapes = new List<cShapeOutline>();
            if (mMaze.PathExist(pPosition, oPlayerOrientation.GetAdjacentPoint(RelativeDirection.Left, pPosition)))
                solWallShapes.Add(GetAdjustedShape(cStaticShapeOutlines.GetArchOutline(CellPosition.Left), Color.Black,ShapeTypes.Polygon));
            else
                solWallShapes.Add(GetAdjustedShape(cStaticShapeOutlines.GetWallOutline(CellPosition.Left), Color.Black, ShapeTypes.Polygon));

            if (mMaze.PathExist(pPosition, oPlayerOrientation.GetAdjacentPoint(RelativeDirection.Forward, pPosition)))
                solWallShapes.Add(GetAdjustedShape(cStaticShapeOutlines.GetArchOutline(CellPosition.Front), Color.Black, ShapeTypes.Polygon));
            else
                solWallShapes.Add(GetAdjustedShape(cStaticShapeOutlines.GetWallOutline(CellPosition.Front), Color.Black, ShapeTypes.Polygon));

            if (mMaze.PathExist(pPosition, oPlayerOrientation.GetAdjacentPoint(RelativeDirection.Right, pPosition)))
                solWallShapes.Add(GetAdjustedShape(cStaticShapeOutlines.GetArchOutline(CellPosition.Right), Color.Black, ShapeTypes.Polygon));
            else
                solWallShapes.Add(GetAdjustedShape(cStaticShapeOutlines.GetWallOutline(CellPosition.Right), Color.Black, ShapeTypes.Polygon));

            return solWallShapes.ToArray();
        }
Exemplo n.º 2
0
        public cShapeOutline[] GetMap(ref cMaze mMaze, Point pPosition, ref cOrientation oPlayerOrientation)
        {
            List<cShapeOutline> solMapShapes = new List<cShapeOutline>();
            cLinePoints[] lpaMazeWalls = mMaze.GetMazeMap();

            foreach (cLinePoints lpLinePoints in lpaMazeWalls)
            {
                solMapShapes.Add(GetAdjustedShape(lpLinePoints.GetPointList(), Color.Black, ShapeTypes.Line));
            }
            solMapShapes.Add(GetAdjustedEllipse(mMaze.GetMazeEnd(), Color.Red));

            if (mMaze.ShowSolution() == true)
                solMapShapes.Add(GetAdjustedSolutionLine(mMaze.GetSolution(), Color.Purple));
            solMapShapes.Add(GetAdjustedArrow(pPosition, oPlayerOrientation.GetCurrentOrientation(), Color.Green));

            return solMapShapes.ToArray();
        }