public new string GetHint(Point pCurrentLocation, cOrientation oPlayerOrientation, bool bPlayAudio = false) { if (plSolution.Count() == 1) return ReturnResponse(saArrivedText[0], bPlayAudio); else { if (plSolution[0] == pCurrentLocation) { plSolution.RemoveAt(0); pLastSquare = pCurrentLocation; } else { plSolution.Insert(0, pLastSquare); pLastSquare = pCurrentLocation; } Direction dVectorDirection = cOrientation.GetDirectionBetweenTwoAdjacentPoints(pCurrentLocation, plSolution[0]); RelativeDirection dRelativeDirection = cOrientation.GetRelativeDirection(oPlayerOrientation.GetCurrentOrientation(),dVectorDirection); if (dRelativeDirection == RelativeDirection.Backward) return ReturnResponse(saTurnAroundText[0], bPlayAudio); if (dRelativeDirection == RelativeDirection.None) return ""; return ReturnResponse(dsaDirections[dRelativeDirection][0], bPlayAudio); } }
public new string GetDirectionHint(Point pCurrentLocation, cOrientation oPlayerOrientation, bool bPlayAudio = false) { return ""; }
public string GetHint(Point pCurrentLocation, cOrientation oPlayerOrientation, bool bPlayAudio = false) { GuideResponses grCurrentResponse; if (plSolution.Count() == 1) grCurrentResponse = GuideResponses.Win; else if (plSolution[0] == pCurrentLocation) { plSolution.RemoveAt(0); pLastSquare = pCurrentLocation; grCurrentResponse = GuideResponses.Good; } else { plSolution.Insert(0, pLastSquare); pLastSquare = pCurrentLocation; grCurrentResponse = GuideResponses.Bad; } int iResponseIndex = new Random().Next(dsaResponses[grCurrentResponse].Count()); if ( (grLastResponse == grCurrentResponse) && (iResponseCount < 4)) { iResponseCount++; return ""; }/* else if (bPlayAudio) { string sLocation = dsaResponses[grCurrentResponse][iResponseIndex].Replace(" ", "") + ".wav"; sLocation = System.IO.Directory.GetCurrentDirectory() + "\\" + sLocation.ToLower(); System.Media.SoundPlayer player = new System.Media.SoundPlayer(sLocation); player.Play(); }*/ grLastResponse = grCurrentResponse; iResponseCount = 1; return ReturnResponse(dsaResponses[grCurrentResponse][iResponseIndex], bPlayAudio); }
public string GetDirectionHint(Point pCurrentLocation, cOrientation oPlayerOrientation, bool bPlayAudio = false) { return "";//Child Classes use this }
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(); }
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(); }