private void SetRadioButtonEnabled(RadioButton rb) { // Если еще не выбрал количетво игроков в фоле if (foulPlayersCount == FoulTypeEnum.None) { rb.Enabled = false; return; } var tag = rb.Tag.ToString(); var rb_action_type = int.Parse(tag); var stages = MarkersWomboCombo.GetFoulMarkerPossibleStages(rb_action_type); if (foulPlayersCount == FoulTypeEnum.NoPlayer) { rb.Enabled = stages.Contains(MarkersWomboCombo.FoulStageEnum.Player0); } if (foulPlayersCount == FoulTypeEnum.SoloPLayer) { rb.Enabled = stages.Contains(MarkersWomboCombo.FoulStageEnum.Player1); } if (foulPlayersCount == FoulTypeEnum.TwoPlayers) { rb.Enabled = stages.Contains(MarkersWomboCombo.FoulStageEnum.Player2); } }
private List <MarkersWomboCombo.FoulStageEnum> GetStages() { var res = MarkersWomboCombo.GetFoulMarkerPossibleStages(this.action_type); switch (foulPlayersCount) { case FoulTypeEnum.TwoPlayers: break; case FoulTypeEnum.SoloPLayer: if (res.Contains(MarkersWomboCombo.FoulStageEnum.Player2)) { res.Remove(MarkersWomboCombo.FoulStageEnum.Player2); } break; case FoulTypeEnum.NoPlayer: if (res.Contains(MarkersWomboCombo.FoulStageEnum.Player2)) { res.Remove(MarkersWomboCombo.FoulStageEnum.Player2); } if (res.Contains(MarkersWomboCombo.FoulStageEnum.Player1)) { res.Remove(MarkersWomboCombo.FoulStageEnum.Player1); } if (res.Contains(MarkersWomboCombo.FoulStageEnum.Player0) == false) { res.Add(MarkersWomboCombo.FoulStageEnum.Player0); } break; case FoulTypeEnum.None: break; default: throw new ArgumentOutOfRangeException(); } return(res); }