Example #1
0
 private void ClearTiltles()
 {
     foreach (var t in Tiltes.Where(_ => _.State != Tilte.States.LOCK))
     {
         t.State = Tilte.States.EMPTY;
     }
 }
Example #2
0
 private void AllStartTiltes()
 {
     foreach (var t in Tiltes.Where(_ => _.State != Tilte.States.LOCK))
     {
         t.State = Tilte.States.START;
     }
 }
Example #3
0
 private void RemoveChoiseTiltles()
 {
     foreach (var t in Tiltes.Where(_ => _.State == Tilte.States.CHOISE))
     {
         t.State = Tilte.States.EMPTY;
     }
 }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 public void TilteEvent(int x, int y)
 {
     TilteEvent(Tiltes.FirstOrDefault(_ => _.X == x && _.Y == y));
 }
Example #7
0
 private bool NoEmptyTilte()
 {
     return(Tiltes.Count(_ => _.State == Tilte.States.EMPTY) == 0);
 }
Example #8
0
 private Tilte GetTilte(int x, int y)
 {
     return(Tiltes.FirstOrDefault(_ => (_.X == x && _.Y == y)));
 }