/// <summary> /// Эта клетка была выделена? /// </summary> /// <param name="pos"></param> /// <returns></returns> public bool isCorrectMove(Position pos) { if (!isHighlighted()) { return(false); } if (moves.Contains(pos) || attacks.Contains(pos)) { return(true); } else { return(false); } }
public void KillFigureHandler(object source, EventArgs args) { Figure fig = (Figure)source; if (alivefigures.Contains(fig)) { alivefigures.Remove(fig); deadfigures.Add(fig); } }
public MyList <Position> GetMoves(Figure fig, MyList <Position> attacks) { MyList <Position> lmoves = new MyList <Position>(); MyList <Position> moves = new MyList <Position>(); lmoves = fig.GetMoves(); foreach (Position move in lmoves) { if (!attacks.Contains(move) && Field.GetFigureAt(move) == null) { moves.Add(move); } } return(moves); }