public void Rotate(Model.Turn turn) { if (FallingBlockSet == null) { return; } if (!CheckCrash(turn)) { FallingBlockSet.Rotate(turn); } else if (!CheckCrash(turn, Direction.Left)) { FallingBlockSet.Move(Direction.Left); FallingBlockSet.Rotate(turn); } else if (!CheckCrash(turn, Direction.Right)) { FallingBlockSet.Move(Direction.Right); FallingBlockSet.Rotate(turn); } else if (FallingBlockSet is BlocksI) { if (!CheckCrash(1, 2, 0)) { FallingBlockSet.Move(Direction.Right); FallingBlockSet.Move(Direction.Right); FallingBlockSet.Rotate(turn); } } Show(); }
public string GetTurnDetailsTitle(Model.Turn turn, int expertfieldid, bool returntext) { var turndetails = turn.TurnDetails.FirstOrDefault(x => x.ExpertFieldID == expertfieldid); if (turndetails == null) { return(null); } // اگر نوع کنترل کمبو باشد باید متن آن استخراج شود و برگردد if (turndetails.ExpertField.FieldType == FieldTypes.ComboBox && returntext) { var r = turndetails.ExpertField.SourceType.SourceValues.FirstOrDefault(x => x.ID.ToString() == turndetails.Value)?.Title; return(r); } return(turndetails.Value); }