private Piece CreatePiece(PointSet unsorted) { Piece piece = new Piece(); PointSet stack = new PointSet(); stack.Insert(0, unsorted.Last()); while (stack.Count > 0) { Point p = stack.First(); stack.RemoveAt(0); if (SeedShouldBeAdded(piece, p)) { piece.Add(p); unsorted.RemovePoint(p); stack.Insert(0, new Point(p.X + 1, p.Y)); stack.Insert(0, new Point(p.X - 1, p.Y)); stack.Insert(0, new Point(p.X, p.Y + 1)); stack.Insert(0, new Point(p.X, p.Y - 1)); } } piece.CreateStatistics(); return(piece); }
public SwellCircle(CirclePiece piece) : base(piece) { Piece.Add(new TextAwesome { Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = SYMBOL_INNER_SIZE, Icon = FontAwesome.fa_asterisk, Shadow = false }); }
public CentreHitCircle(CirclePiece piece) : base(piece) { Piece.Add(new CircularContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(SYMBOL_INNER_SIZE), Masking = true, Children = new[] { new Box { RelativeSizeAxes = Axes.Both } } }); }
public RimHitCircle(CirclePiece piece) : base(piece) { Piece.Add(new CircularContainer { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(SYMBOL_SIZE), BorderThickness = SYMBOL_BORDER, BorderColour = Color4.White, Masking = true, Children = new[] { new Box { RelativeSizeAxes = Axes.Both, Alpha = 0, AlwaysPresent = true } } }); }
private Piece CreatePiece(PointSet unsorted) { Piece piece = new Piece(); PointSet stack = new PointSet(); stack.Push(unsorted.FindLast(x => true)); while (stack.Count != 0) { Point p = stack.Pop(); if (SeedShouldBeAdded(piece, p)) { piece.Add(p); unsorted.RemovePoint(p); stack.Push(new Point(p.X + 1, p.Y)); stack.Push(new Point(p.X - 1, p.Y)); stack.Push(new Point(p.X, p.Y + 1)); stack.Push(new Point(p.X, p.Y - 1)); } } piece.CreateStatistics(); return(piece); }