//cell is a four linked list public CLCell(int row, int column, CLCell top = null, CLCell bottom = null, CLCell left = null, CLCell right = null) { this.colour = CLColour.CLNone; this.row = row; this.column = column; this.selected = false; this.top = top; this.bottom = bottom; this.left = left; this.right = right; if (top != null) { top.bottom = this; } if (bottom != null) { bottom.top = this; } if (left != null) { left.right = this; } if (right != null) { right.left = this; } }
private static Color CLColourToColor(CLColour colour) { if (colour == CLColour.CLRed) { return(Color.FromRgba(255, 0, 0, 255)); } else if (colour == CLColour.CLYellow) { return(Color.FromRgba(255, 255, 0, 255)); } else if (colour == CLColour.CLGreen) { return(Color.FromRgba(0, 255, 0, 255)); } else if (colour == CLColour.CLCyan) { return(Color.FromRgba(0, 255, 255, 255)); } else if (colour == CLColour.CLBlue) { return(Color.FromRgba(0, 0, 255, 255)); } else if (colour == CLColour.CLPink) { return(Color.FromRgba(255, 0, 255, 255)); } else if (colour == CLColour.CLBrown) { return(Color.FromRgba(63, 15, 0, 255)); } else { return(Color.FromRgba(127, 127, 127, 255)); } }
private Color CLColourToColor(CLColour colour) { if (colour == CLColour.CLRed) { return(Color.Argb(255, 255, 0, 0)); } else if (colour == CLColour.CLYellow) { return(Color.Argb(255, 255, 255, 0)); } else if (colour == CLColour.CLGreen) { return(Color.Argb(255, 0, 255, 0)); } else if (colour == CLColour.CLCyan) { return(Color.Argb(255, 0, 255, 255)); } else if (colour == CLColour.CLBlue) { return(Color.Argb(255, 0, 0, 255)); } else if (colour == CLColour.CLPink) { return(Color.Argb(255, 255, 0, 255)); } else if (colour == CLColour.CLBrown) { return(Color.Argb(255, 63, 15, 0)); } else { return(Color.Argb(255, 127, 127, 127)); } }
private void BlowAnimation(CLCell newCell, CLCell cell, CLDirection dir) { CLCell c = cell; CLColour tempColour = newCell.colour; if (dir == CLDirection.CLLeft) { while (c.left != null && c.colour == c.left.colour) { c.colour = CLColour.CLNone; c = c.left; //TODO: add fancy opengl animations } } else if (dir == CLDirection.CLDown) { while (c.bottom != null && c.colour == c.bottom.colour) { c.colour = CLColour.CLNone; c = c.bottom; //TODO: add fancy opengl animations } } else if (dir == CLDirection.CLLeftDown) { while (c.bottom != null && c.left != null && c.colour == c.bottom.left.colour) { c.colour = CLColour.CLNone; c = c.bottom.left; //TODO: add fancy opengl animations } } else if (dir == CLDirection.CLRightDown) { while (c.bottom != null && c.right != null && c.colour == c.bottom.right.colour) { c.colour = CLColour.CLNone; c = c.bottom.right; //TODO: add fancy opengl animations } } c.colour = CLColour.CLNone; newCell.colour = tempColour; }
//cell is a four linked list public CLCell(int row, int column, CLCell top = null, CLCell bottom = null, CLCell left = null, CLCell right = null) { this.Colour = CLColour.CLNone; this.Row = row; this.Column = column; this.Selected = false; this.KeySelected = false; this.Top = top; this.Bottom = bottom; this.Left = left; this.Right = right; if (top != null) { top.Bottom = this; } if (bottom != null) { bottom.Top = this; } if (left != null) { left.Right = this; } if (right != null) { right.Left = this; } /* this.tap = new BoxView() { * BackgroundColor = Color.Transparent * }; * var tapped = new TapGestureRecognizer(); * tapped.Tapped += (sender, ev) => { * this?.Action?.Invoke(); * }; * this.tap.GestureRecognizers.Add(tapped); * this.added = false;*/ this.Blowing = false; this.BlowingStarted = false; this.Appearing = false; this.Moving = false; this.AnimTime = 0; }