コード例 #1
0
 public WumpusGameLogic(WumpusSetting setting, IWumpusDataAccess dataAccess)
 {
     _dataAccess    = dataAccess;
     Setting        = setting;
     IsStarted      = false;
     _isSaving      = false;
     ShowFieldEnd   = true;
     ShowFieldDebug = false;
 }
コード例 #2
0
        public WumpusViewModel(WumpusGameLogic gameLogic, IWumpusDataAccess dataAccess)
        {
            _dataAccess = dataAccess;
            _gameLogic  = gameLogic;
            SetGameEventHandlers();

            DiffIndex = 0;
            Info      = "Játék indításához válassz nehézséget, és kattints a Játék kezdése gombra!";
            OnPropertyChanged("Info");

            IsShowEndChecked   = true;
            IsShowFieldChecked = false;

            StartGameCommand = new DelegateCommand(o => StartGame());
            //SaveGameCommand = new DelegateCommand(SavingGame);
            //LoadGameCommand = new DelegateCommand(LoadingGame);
            ExitGameCommand  = new DelegateCommand(o => OnQuitEvent());
            StepCommand      = new DelegateCommand(o => Step((Direction)Convert.ToInt32(o)));
            ShootCommand     = new DelegateCommand(o => ShootArrow());
            GrabCommand      = new DelegateCommand(o => GrabGold());
            ShowEndCommand   = new DelegateCommand(o => { IsShowEndChecked = !IsShowEndChecked; SetExtraSettings(); UpdateField(); });
            ShowFieldCommand = new DelegateCommand(o => { IsShowFieldChecked = !IsShowFieldChecked; SetExtraSettings(); UpdateField(); });
        }
コード例 #3
0
 public WumpusGameLogic(IWumpusDataAccess dataAccess) : this(Levels.GetSetting(0), dataAccess)
 {
 }