public List <BonusPoint> GetHorizontalLinesList(List <Match> horMatches, List <Match> destroy, Bit firstBit = null, Bit secondBit = null) { List <BonusPoint> points = new List <BonusPoint>(); foreach (var hor in horMatches) { if (hor.Count == 4) { BonusPoint bombPoint = GetBonusPoint(hor, new Point(hor.Pos.X + 1, hor.Pos.Y)); if (firstBit != null && firstBit.Position.Y == hor.Pos.Y && firstBit.Position.X >= hor.Pos.X && firstBit.Position.X < hor.Pos.X + hor.Count) { bombPoint = GetBonusPoint(firstBit, new Point(firstBit.Position.X, firstBit.Position.Y)); } if (secondBit != null && secondBit.Position.Y == hor.Pos.Y && secondBit.Position.X >= hor.Pos.X && secondBit.Position.X < hor.Pos.X + hor.Count) { bombPoint = GetBonusPoint(firstBit, new Point(secondBit.Position.X, secondBit.Position.Y)); } points.Add(bombPoint); } destroy.Add(hor); } return(points); }
private BonusPoint GetBonusPoint(Bit bit, Point point) { BonusPoint bonusPoint = new BonusPoint(); bonusPoint.point = point; bonusPoint.type = bit.BitType; return(bonusPoint); }
private BonusPoint GetBonusPoint(Match match, Point point) { BonusPoint bonusPoint = new BonusPoint(); bonusPoint.point = point; bonusPoint.type = match.Type; return(bonusPoint); }
public List <BonusPoint> GetLineBombPoints(List <Match> horMatches, List <Match> vertMatches, Bit firstBit = null, Bit secondBit = null) { List <BonusPoint> points = new List <BonusPoint>(); foreach (var hor in horMatches) { if (hor.Count >= 5) { BonusPoint bombPoint = GetBonusPoint(hor, new Point(hor.Pos.X + 3, hor.Pos.Y)); if (firstBit != null && firstBit.Position.Y == hor.Pos.Y && firstBit.Position.X >= hor.Pos.X && firstBit.Position.X < hor.Pos.X + hor.Count) { bombPoint = GetBonusPoint(firstBit, new Point(firstBit.Position.X, firstBit.Position.Y)); } if (secondBit != null && secondBit.Position.Y == hor.Pos.Y && secondBit.Position.X >= hor.Pos.X && secondBit.Position.X < hor.Pos.X + hor.Count) { bombPoint = GetBonusPoint(firstBit, new Point(secondBit.Position.X, secondBit.Position.Y)); } points.Add(bombPoint); } } foreach (var vert in vertMatches) { if (vert.Count >= 5) { BonusPoint bombPoint = GetBonusPoint(vert, new Point(vert.Pos.X, vert.Pos.Y + 3)); if (firstBit != null && firstBit.Position.X == vert.Pos.X && firstBit.Position.Y >= vert.Pos.Y && firstBit.Position.Y < vert.Pos.Y + vert.Count) { bombPoint = GetBonusPoint(firstBit, new Point(firstBit.Position.X, firstBit.Position.Y)); } if (secondBit != null && secondBit.Position.X == vert.Pos.X && secondBit.Position.Y >= vert.Pos.Y && secondBit.Position.Y < vert.Pos.Y + vert.Count) { bombPoint = GetBonusPoint(firstBit, new Point(secondBit.Position.X, secondBit.Position.Y)); } points.Add(bombPoint); } } return(points); }
public List <BonusPoint> GetVerticalLinesList(List <Match> vertMatches, List <Match> destroy, Bit firstBit = null, Bit secondBit = null) { List <BonusPoint> points = new List <BonusPoint>(); foreach (var vert in vertMatches) { if (vert.Count == 4) { BonusPoint bombPoint = GetBonusPoint(vert, new Point(vert.Pos.X, vert.Pos.Y + 1)); if (firstBit != null && firstBit.Position.X == vert.Pos.X && firstBit.Position.Y >= vert.Pos.Y && firstBit.Position.Y < vert.Pos.Y + vert.Count) { bombPoint = GetBonusPoint(firstBit, new Point(firstBit.Position.X, firstBit.Position.Y)); } if (secondBit != null && secondBit.Position.X == vert.Pos.X && secondBit.Position.Y >= vert.Pos.Y && secondBit.Position.Y < vert.Pos.Y + vert.Count) { bombPoint = GetBonusPoint(firstBit, new Point(secondBit.Position.X, secondBit.Position.Y)); } points.Add(bombPoint); } destroy.Add(vert); } return(points); }