private void set(EFigures FigureType, int Color, GameBoard Board, FigurePosition Position) { this.color = Color; this.figuretype = FigureType; this.gameBoard = Board; this.position = Position; configure(); }
public UInt64 GetMoveMask(Int16 Position, Figure Figure) { UInt64 returnValue = 0; EFigures searchType = Figure.Type; if (Figure.Type == EFigures.Pawn && Figure.Color == Defaults.BLACK) { searchType = EFigures.PawnBlack; } else if (Figure.Type == EFigures.Pawn) { searchType = EFigures.PawnWhite; } if (this.attackData.Count == 0) { if (!ReadDatabaseFromDisk()) { BuildAttackDatabase(); } } returnValue = this.attackData[BuildAttackKey(searchType, Position)]; //Depending on the figure set the search creteria //UInt64 returnValue = 0; //EFigures searchType = Figure.Type; //if (Figure.Type == EFigures.Pawn && Figure.Color == Defaults.BLACK) //{ // searchType = EFigures.PawnBlack; //} //else if(Figure.Type == EFigures.Pawn) { // searchType = EFigures.PawnWhite; //} ////Create the search document //QueryDocument doc = new QueryDocument(); //doc.Add("F",(int)searchType); //doc.Add("P", Position); //var result = attacks.Find(doc); ////If we found something in the database return the first result //if (result.Count() > 0) //{ // returnValue = result.ElementAt(0).M; //} return(returnValue); }
private void SaveAndClose(EFigures Result) { this.Result = Result; this.Close(); }
public PromotionForm() { InitializeComponent(); Result = EFigures.NAN; }
private string BuildAttackKey(EFigures Type, Int32 Position) { return(string.Format("{0}:{1}", (int)Type, Position)); }
private void SaveInDB(Int32 Position, EFigures Type, UInt64 MoveMask) { //Insert the new position in the datbase //attacks.Insert(new AttackDocument() { F = (int)Type, M = MoveMask, P = Position }); attackData.Add(BuildAttackKey(Type, Position), MoveMask); }
public Figure(EFigures FigureType, int Color, GameBoard Board, FigurePosition Position) { set(FigureType, Color, Board, Position); }
public Figure(EFigures FigureType, int Color, GameBoard Board) { set(FigureType, Color, Board, null); }
public Figure(int Color, EFigures Type) { this.color = Color; this.type = Type; }