Example #1
0
        public Model(BaseLayer baseLayer, Preferences preferences)
        {
            //конструктор класса, создает задачу и константу (только одна, Ставка)
            _baseLayer = baseLayer;
            _preferences = preferences;
            stake = new TaskParamName() { Name = "Ставка" };
            stakeValue = new TaskParam { Task = _baseLayer.Task };
            bonus = new EventParamName() { Name = "Бонус" };
            soeg = new CombinParamName() { Name = "SoEG" };

            InitialEvents = preferences.evenoddGame
                                ? InitialEvents = preferences.evenoddNames
                                : InitialEvents = preferences.numericNames;
            game = new Dice(InitialEvents.Length, preferences.numberofthrowings); //, preferences.numberofoutcomesperstake);
            GenerateEvents();
        }
Example #2
0
 public Model(BaseLayer _baseLayer, Preferences _preferences)
 {
     baseLayer = _baseLayer;
     preferences = _preferences;
     numberOfHeads = new EventParamName() { Name = "Кол-во Г" };
     numberOfTails = new EventParamName() { Name = "Кол-во Р" };
     numberOfDoubleHeads = new EventParamName() { Name = "Кол-во ГГ" };
     headBonus = new TaskParamName() { Name = "Бонус за Г" };
     tailCost = new TaskParamName() { Name = "Бонус за Р" };
     doubleHeadBonus = new TaskParamName() { Name = "Бонус за ГГ" };
     headBonusValue = new TaskParam() { Task = baseLayer.Task, Value = preferences.HeadBonus };
     tailCostValue = new TaskParam() { Task = baseLayer.Task, Value = preferences.TailCost };
     doubleHeadBonusValue = new TaskParam() { Task = baseLayer.Task, Value = preferences.DoubleHeadBonus };
     InitialEvents = new char[]{'Г', 'Р'};
     game = new Coin(InitialEvents.Length, preferences.NumberOfThrowings);
     numberOfHeadsInOutcomes = game.CountSequences(0);
     numberOfTailsInOutcomes = game.CountSequences(1);
     numberOfDoubleHeadsInOutcomes = game.CountSequences(0, 3);
 }
 public TaskParams()
 {
     Shtraf = new TaskParam();
     Premia = new TaskParam();
 }
 public void AddTaskParam(Task task, TaskParam param, TaskParamName name, decimal value)
 {
     if (param == null || task == null || name == null) return;
     param.Task = task;
     param.TaskParamName = name;
     param.Value = value;
     dssDbContext.TaskParams.Add(param);
 }