// 2 note // 12 papapapa // 24 beat // 32 no beat // 36 beat again // 52 no beat : 2m //public void SetColor(Color color); public void Move(int x, int y, float duration = 0) { // moves square by (x, y) tile units // // lock properties: Translation, Existence (automatic) // lock destination tiles (we ignore the in-between) // apply move // unlock properties // unlock origin tiles // TODO fix larger rect problem hax Transform(rect.Translate(x, y), duration); }
public override IExplicitShape <GridPoint2> Transform(IExplicitShape <GridPoint2> input) { var offset1 = offset.GetGridPoint(); var shape = input.Translate(offset1); var storageRect = GridRect.Translate(input.Bounds, offset1); return(shape.ToExplicit(storageRect)); }
public IEnumerable <GraphicEntity1> FindAdjacentGraphics(GridRect gr, bool canOverlap = true) { var rects = new GridRect[4] { gr.Translate(0, 1), gr.Translate(0, -1), gr.Translate(-1, 0), gr.Translate(1, 0) }.Shuffle(); foreach (var rect in rects) { // TODO yield overlap, remove current rect var g = FindGraphicAtPosition(rect.min.x, rect.min.y); if (g != null) { yield return(g); } } }