private static bool RedTokenEndField(FieldViewModel f)
 {
     return f.Row == 1 && f.Column == 2;
 }
 private static bool RedTokenStartField(FieldViewModel f)
 {
     return f.Row == 0 && f.Column == 0;
 }
 private static bool GreenTokenEndField(FieldViewModel f)
 {
     return f.Row == 3 && f.Column == 1;
 }
 private static bool RedTokenCornerField(FieldViewModel f)
 {
     return f.Row == 0 && f.Column == 2;
 }
 private static bool BlueTokenStartField(FieldViewModel f)
 {
     return f.Row == 7 && f.Column == 7;
 }
 private static bool GreenTokenCornerField(FieldViewModel f)
 {
     return f.Row == 0 && f.Column == 1;
 }
 private static bool BlueTokenCornerField(FieldViewModel f)
 {
     return f.Row == 1 && f.Column == 7;
 }
 private static bool BlueTokenEndField(FieldViewModel f)
 {
     return f.Row == 1 && f.Column == 0;
 }
Exemplo n.º 9
0
 public void Setup()
 {
     this.field = A.Fake<Field>();
     this.testee = new FieldViewModel(this.field);
 }
 private static bool StartField(FieldViewModel f)
 {
     return f.Row == 0 && f.Column == 2;
 }
 private static bool EndField(FieldViewModel f)
 {
     return f.Row == 0 && f.Column == 4;
 }
Exemplo n.º 12
0
        private void PlaceToken(FieldViewModel fieldViewModel)
        {
            MoveResult moveResult = this.gameBoard.PlaceToken(fieldViewModel.Field);
            var fields = this.FieldViewModels;
            this.FieldViewModels = null;
            this.FieldViewModels = fields;
            if (!moveResult.IsValid)
            {
                this.IsMessageVisible = true;
                this.MoveResultText = moveResult.Message;

                var player = new SoundPlayer("WebServiceUnavailable.WAV");
                player.Play();
                this.timer = new Timer(3000);
                this.timer.Elapsed += this.MessageDisplayElapsed;
                this.timer.Start();
            }

            // Todo: Implement IsFinished in MoveResult and do NotifyPropertyChanged only when it is true.
            this.NotifyPropertyChanged(() => this.Scores);
        }
 private static bool CornerField(FieldViewModel f)
 {
     return f.Row == 4 && f.Column == 0;
 }