private void ClearTiltles() { foreach (var t in Tiltes.Where(_ => _.State != Tilte.States.LOCK)) { t.State = Tilte.States.EMPTY; } }
private void AllStartTiltes() { foreach (var t in Tiltes.Where(_ => _.State != Tilte.States.LOCK)) { t.State = Tilte.States.START; } }
private void RemoveChoiseTiltles() { foreach (var t in Tiltes.Where(_ => _.State == Tilte.States.CHOISE)) { t.State = Tilte.States.EMPTY; } }
private bool CanMoove(int x, int y) { var t = Tiltes.FirstOrDefault(_ => (_.X == x && _.Y == y)); if (t != null && t.State == Tilte.States.EMPTY) { return(true); } return(false); }
private bool UpdateTilteState(Tilte.States newState, int x, int y) { var t = Tiltes.FirstOrDefault(_ => (_.X == x && _.Y == y)); if (t != null && t.State == Tilte.States.EMPTY) { t.State = newState; return(true); } return(false); }
public void TilteEvent(int x, int y) { TilteEvent(Tiltes.FirstOrDefault(_ => _.X == x && _.Y == y)); }
private bool NoEmptyTilte() { return(Tiltes.Count(_ => _.State == Tilte.States.EMPTY) == 0); }
private Tilte GetTilte(int x, int y) { return(Tiltes.FirstOrDefault(_ => (_.X == x && _.Y == y))); }