|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace ClassLib000.Chess
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public class Player
|
|
|
|
|
{
|
|
|
|
|
public Figure Пешка1;
|
|
|
|
|
public Figure Пешка2;
|
|
|
|
|
public Figure Пешка3;
|
|
|
|
|
public Figure Пешка4;
|
|
|
|
|
public Figure Пешка5;
|
|
|
|
|
public Figure Пешка6;
|
|
|
|
|
public Figure Пешка7;
|
|
|
|
|
|
|
|
|
|
public Figure Пешка8;
|
|
|
|
|
|
|
|
|
|
public Figure Ладья1;
|
|
|
|
|
public Figure Ладья2;
|
|
|
|
|
public Figure Конь1;
|
|
|
|
|
|
|
|
|
|
public void FromString(string fileContent) {
|
|
|
|
|
// ...
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string AsString() {
|
|
|
|
|
StringBuilder lineStringBuilder = new StringBuilder();
|
|
|
|
|
lineStringBuilder.AppendFormat("{0}|", Пешка1.AsTextString());
|
|
|
|
|
lineStringBuilder.AppendFormat("{0}|", Пешка2.AsTextString());
|
|
|
|
|
lineStringBuilder.AppendFormat("{0}|", Пешка3.AsTextString());
|
|
|
|
|
lineStringBuilder.AppendFormat("{0}|", Пешка4.AsTextString());
|
|
|
|
|
// ..
|
|
|
|
|
return lineStringBuilder.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Figure[] GetBrokenFigures()
|
|
|
|
|
{
|
|
|
|
|
// TODO:
|
|
|
|
|
return new Figure[0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Figure Конь2;
|
|
|
|
|
|
|
|
|
|
// TODO: ... //
|
|
|
|
|
|
|
|
|
|
#region methods
|
|
|
|
|
internal void Init(EColor enColor)
|
|
|
|
|
{
|
|
|
|
|
this.Пешка1 = new Figure(enColor, EFigureType.Пешка, 1, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка2 = new Figure(enColor, EFigureType.Пешка, 2, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка3 = new Figure(enColor, EFigureType.Пешка, 3, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка4 = new Figure(enColor, EFigureType.Пешка, 4, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка5 = new Figure(enColor, EFigureType.Пешка, 5, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка6 = new Figure(enColor, EFigureType.Пешка, 6, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка7 = new Figure(enColor, EFigureType.Пешка, 7, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Пешка8 = new Figure(enColor, EFigureType.Пешка, 8, enColor == EColor.White ? 2 : 7);
|
|
|
|
|
this.Ладья1 = new Figure(enColor, EFigureType.Ладья, 1, enColor == EColor.White ? 1 : 8);
|
|
|
|
|
this.Ладья2 = new Figure(enColor, EFigureType.Ладья, 8, enColor == EColor.White ? 1 : 8);
|
|
|
|
|
this.Конь1 = new Figure(enColor, EFigureType.Конь, 2, enColor == EColor.White ? 1 : 8);
|
|
|
|
|
this.Конь2 = new Figure(enColor, EFigureType.Конь, 7, enColor == EColor.White ? 1 : 8);
|
|
|
|
|
// TODO: ... //
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|