protected override Event CreateEventTemplate()
 {
     var eventParamName = new EventParamName { Name = "Фактич. брак" };
     return new Event
     {
         Name = "Событие",
         Probability = 1,
         SavingId = this.SavingID,
         EventParams = new Collection<EventParam>
             {
                 new EventParam{EventParamName = eventParamName
             }}
     };
 }
        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();
        }
 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 void AddEventParam( Event eEvent, EventParam param, EventParamName name, decimal value)
 {
     if (param == null || eEvent == null) return;
     param.Event = eEvent;
     param.Value = value;
     param.EventParamName = name;
     dssDbContext.EventParams.Local.Add(param);
 }
 public void AddEventParamName(EventParamName eventParamName)
 {
     if (eventParamName == null) return;
     dssDbContext.EventParamNames.Add(eventParamName);
 }