public static string GetWord(DifficultMode mode) { string[] ar = null; switch (mode) { case DifficultMode.EASY: ar = EasyWords; break; case DifficultMode.MEDIUM: ar = MediunWords; break; case DifficultMode.HARD: ar = HardWords; break; case DifficultMode.FUTBOL: ar = FutbolWords; break; default: ar = MediunWords; break; } int max = Random.Range(1, ar.Length); int min = Random.Range(0, (max - 1)); int r = Random.Range(min, max); return(ar[r]); }
public MinesweeperPresenter(IView view, MinesweeperModel model) { _view = view; _model = model; _view.SetPresenter(this); _currentDifficultMode = _model.DifficultModes["Test"]; _model.Timer.TimeUpdated += GameTimerUpdate; _model.Timer.SynchronizingObject = (ISynchronizeInvoke)_view; _model.Win += Win; _model.Defeat += Defeat; StartNewGame(this, EventArgs.Empty); _view.StartView(); }
/// <summary> /// /// </summary> void Awake() { m_DifficultMode = bl_GameInfo.Instance.Category; m_Mode = bl_GameInfo.Instance.GameMode; }