private bool VersucheZuSetzen() { if (FeldIstLeer()) { Spielfeld.First(x => x.xCoordinate == cursorX && x.yCoordinate == cursorY).Typ = Spieler.First(x => x.MeinZug).Zeichen.ToLower() == "x" ? FeldTyp.X : FeldTyp.O; return(true); } return(false); }
private bool DreiInEinerDiagonale() { if ( Spielfeld.First(x => x.xCoordinate == 0 && x.yCoordinate == 0).Typ != FeldTyp.Leer && Spielfeld.First(x => x.xCoordinate == 0 && x.yCoordinate == 0).Typ == Spielfeld.First(x => x.xCoordinate == 1 && x.yCoordinate == 1).Typ&& Spielfeld.First(x => x.xCoordinate == 0 && x.yCoordinate == 0).Typ == Spielfeld.First(x => x.xCoordinate == 2 && x.yCoordinate == 2).Typ ) { return(true); } else if ( Spielfeld.First(x => x.xCoordinate == 2 && x.yCoordinate == 0).Typ != FeldTyp.Leer && Spielfeld.First(x => x.xCoordinate == 2 && x.yCoordinate == 0).Typ == Spielfeld.First(x => x.xCoordinate == 1 && x.yCoordinate == 1).Typ&& Spielfeld.First(x => x.xCoordinate == 2 && x.yCoordinate == 0).Typ == Spielfeld.First(x => x.xCoordinate == 0 && x.yCoordinate == 2).Typ ) { return(true); } return(false); }
private bool FeldIstLeer() { return(Spielfeld.First(x => x.xCoordinate == cursorX && x.yCoordinate == cursorY).Typ == FeldTyp.Leer); }