internal bool IsHit(Figure figure) { foreach (var p in pList) { if(figure.IsHit(p)) return true; } return false; }
public bool IsHit(Figure figure) { foreach (var p in pointsList) { if (figure.IsHit(p)) { return(true); } } return(false); }
internal bool IsHit(Figure figure) { foreach (var p in dots) { if (figure.IsHit(p)) { return(true); } } return(false); }
public bool IsHit(Figure figure) { foreach (Point p in pline) { if (figure.IsHit(p)) { return(true); } } return(false); }
public bool IsHit(Figure figure) { foreach (Point point in pList) { if (figure.IsHit(point)) { return(true); } } return(false); }
internal bool IsHit(Figure figure) { foreach (Point p in pList) { if (figure.IsHit(p)) { return(true); } } return(false); }
internal bool IsHit(Figure figure) { foreach (var point in pointList) { if (figure.IsHit(point)) { return(true); } } return(false); }
/* Функция возвращает столкнулась ли змейка со стенами */ internal bool IsHit(Figure figure) { foreach (var fig in pList) { if (figure.IsHit(fig)) { return(true); } } return(false); }
/// <summary> /// Проверка столкновения /// </summary> /// <param name="figure">Фигура</param> /// <returns>True - столкновение было, False - столкновения не было</returns> public bool IsHit(Figure figure) { foreach (var linePoint in LinePoints) { if (figure.IsHit(linePoint)) { return(true); } } return(false); }
public Point CreateFood(Figure figure) { while (true) { int x = random.Next(2, mapWidth - 2); int y = random.Next(2, mapHeight - 2); Point p = new Point(x, y, symb); if (!figure.IsHit(p)) { return(p); } } }
public Point CreateFood(Figure snake) { Point p = new Point(0, 0, sym); do { Random random = new Random(); p.x = random.Next(2, mapWidht - 2); p.y = random.Next(2, mapHeight - 2); } while (snake.IsHit(p)); return(p); }
internal virtual bool IsHit(Figure figure) { if (_PointList != null) { foreach (Point point in this._PointList) { if (figure.IsHit(point)) { return(true); } } } return(false); }
public Point Create(Figure figure) { int x = random.Next(3, this.MapWidth - 3); int y = random.Next(3, this.MapHeight - 3); Point food = new Point(x, y, this.Symbol, ConsoleColor.Yellow); if (figure.IsHit(food)) { food.Clear(); Create(figure); } return(food); }
public Point CreateFood(Figure figure) { while (true) { int x = random.Next(2, mapWidth - 2); int y = random.Next(2, mapHeight - 2); Console.SetCursorPosition(121, 3); Console.WriteLine($"Food X = {x}, Y = {y}"); Point newPoint = new Point(x, y, food); if (!figure.IsHit(newPoint) && newPoint != prevPoint) { prevPoint = newPoint; return(newPoint); } else { continue; } } }
public bool IsHit(Figure figure) { return(_points.Any(point => figure.IsHit(point))); }
public static bool IsHit(Walls w, Point p) => w.walls.Any(f => Figure.IsHit(f, p));
public static bool IsHit(Walls w, Figure f) => w.walls.Any(f1 => Figure.IsHit(f1, f));