private FieldBase copy(field original) { this.Win = original.Win; this.Lose = original.Lose; this.FieldBoad = original.FieldBoad.Clone(); return(this); }
public string SelectLineBack(Logic.Boad boad) { var lineFlag = boad.LineFlag(); line[selecting].Stroke = lineBrushDefault; while (lineFlag[selecting = (selecting + 59) % 60]) { } line[selecting].Stroke = lineBrushSelecting; return(lineName(selecting)); }
public ShowWindowBoadPanel(Logic.Boad boad) { Width = Height = boadSize; Background = new SolidColorBrush(Colors.White); Brush lineBrush = new SolidColorBrush(Colors.LightGray); Brush smallRectBrush = new SolidColorBrush(Colors.Black); int lineLength = (boadSize - padding * 2 - strokeThickness * 6) / 5; //縦線のラベル { TextBlock tb = new TextBlock(); tb.Height = padding; tb.Width = padding; tb.Text = ""; tb.FontSize = 20; this.Children.Add(tb); } for (int i = 0; i < 6; i++) { TextBlock tb = new TextBlock(); tb.Height = padding; tb.Width = (i < 5) ? lineLength + strokeThickness : padding; tb.Text = (i == 0) ? "A" : (i == 1) ? "B" : (i == 2) ? "C" : (i == 3) ? "D" : (i == 4) ? "E" : (i == 5) ? "F" : ""; tb.FontSize = 20; this.Children.Add(tb); } for (int i = 0; i < 5; i++) { //横線のラベル { TextBlock tb = new TextBlock(); tb.Height = lineLength + strokeThickness; tb.Width = padding; tb.Text = (i + 1).ToString(); tb.FontSize = 20; Children.Add(tb); } WrapPanel wp = new WrapPanel(); wp.Width = boadSize - padding * 2; wp.Height = lineLength + strokeThickness; //横線 for (int j = 0; j < 5; j++) { var nowrect = new Rectangle(); nowrect.Width = nowrect.Height = strokeThickness; nowrect.Fill = smallRectBrush; wp.Children.Add(nowrect); var nowline = line[i * 11 + j] = new Line(); nowline.X1 = 0; nowline.Y1 = strokeThickness * 0.5; nowline.X2 = lineLength; nowline.Y2 = strokeThickness * 0.5; nowline.Stroke = lineBrush; nowline.StrokeThickness = strokeThickness; wp.Children.Add(nowline); } { var nowrect = new Rectangle(); nowrect.Width = nowrect.Height = strokeThickness; nowrect.Fill = smallRectBrush; wp.Children.Add(nowrect); } //縦線と正方形を交互に for (int j = 0; j < 5; j++) { var nowline = line[i * 11 + j + 5] = new Line(); nowline.X1 = strokeThickness * 0.5; nowline.Y1 = 0; nowline.X2 = strokeThickness * 0.5; nowline.Y2 = lineLength; nowline.Stroke = lineBrush; nowline.StrokeThickness = strokeThickness; wp.Children.Add(nowline); var nowrect = rectangle[i * 5 + j] = new Rectangle(); nowrect.Width = lineLength; nowrect.Height = lineLength; wp.Children.Add(nowrect); } { var nowline = line[i * 11 + 10] = new Line(); nowline.X1 = strokeThickness * 0.5; nowline.Y1 = 0; nowline.X2 = strokeThickness * 0.5; nowline.Y2 = lineLength; nowline.Stroke = lineBrush; nowline.StrokeThickness = strokeThickness; wp.Children.Add(nowline); } this.Children.Add(wp); //右パディング分 { TextBlock tb = new TextBlock(); tb.Height = lineLength + strokeThickness; tb.Width = padding; tb.Text = ""; tb.FontSize = 20; this.Children.Add(tb); } } //横線のラベル { TextBlock tb = new TextBlock(); tb.Height = padding; tb.Width = padding; tb.Text = "6"; tb.FontSize = 20; this.Children.Add(tb); } { WrapPanel wp = new WrapPanel(); wp.Width = boadSize - padding * 2; wp.Height = padding; //一番下の横線 for (int j = 0; j < 5; j++) { var nowrect = new Rectangle(); nowrect.Width = nowrect.Height = strokeThickness; nowrect.Fill = smallRectBrush; wp.Children.Add(nowrect); var nowline = line[55 + j] = new Line(); nowline.X1 = 0; nowline.Y1 = strokeThickness * 0.5; nowline.X2 = lineLength; nowline.Y2 = strokeThickness * 0.5; nowline.Stroke = lineBrush; nowline.StrokeThickness = strokeThickness; wp.Children.Add(nowline); } { var nowrect = new Rectangle(); nowrect.Width = nowrect.Height = strokeThickness; nowrect.Fill = smallRectBrush; wp.Children.Add(nowrect); } this.Children.Add(wp); } LineColorChange(boad.LineFlag()); SquareColorChange(boad.SquareNum()); }
public void ColorChange(Logic.Boad boad) { LineColorChange(boad.LineFlag()); SquareColorChange(boad.SquareNum()); }
public field() { FieldBoad = new Logic.Boad(); }