Esempio n. 1
0
    static public IGameParameters GetParametersFromPreferences(string gameType, Preferences preferences)
    {
      var gameParameters = new MultiplyGameParameters(gameType);
      gameParameters.tableOf = preferences.TableOf;
      gameParameters.isRandom = preferences.RandomQuestions;

      return (IGameParameters)gameParameters;
    }
Esempio n. 2
0
        static public IGameParameters GetParametersFromPreferences(string gameType, Preferences preferences)
        {
            var gameParameters = new MultiplyGameParameters(gameType);

            gameParameters.tableOf  = preferences.TableOf;
            gameParameters.isRandom = preferences.RandomQuestions;

            return((IGameParameters)gameParameters);
        }
Esempio n. 3
0
        public IGameParameters GetGameParameters(string gameType)
        {
            IGameParameters gameParameters;

            switch (gameType)
            {
            case "Add":
            case "Subtract":
                gameParameters = AddGameParameters.GetParametersFromPreferences(gameType, preferences);
                break;

            case "Multiply":
            case "Divide":
                gameParameters = MultiplyGameParameters.GetParametersFromPreferences(gameType, preferences);
                break;

            default:
                gameParameters = GameParameters.CreateDefaultGameParameters(gameType);
                break;
            }
            return(gameParameters);
        }
Esempio n. 4
0
 public MultiplicationTableGame(MultiplyGameParameters gameParameters)
 {
     tableOf         = gameParameters.GetTableOf();
     eenTafel        = gameParameters.GetIsRandom();
     randomGenerator = new RandomValueGenerator();
 }
Esempio n. 5
0
 public DivisionionTableGame(MultiplyGameParameters gameParameters)
 {
   tableOf = gameParameters.GetTableOf();
   eenTafel = gameParameters.GetIsRandom();
   randomGenerator = new RandomValueGenerator();
 }