Exemple #1
0
 static public IEnumerable <KeyValuePair <T, float> > Deconstruct <T>(Roulette <T> item)
 {
     return(item.Deconstruct());
 }
 public async Task <JsonHttpStatusResult> OpenRouletteOperation([FromBody] Roulette rouletteSearch)
 {
     return(await rouletteLogic.OpenRouletteOperation(rouletteSearch));
 }
Exemple #3
0
 public void RunBeforeTests()
 {
     _uut = new Roulette(new FakeRandomize(0));
 }
Exemple #4
0
 /// <summary>
 /// Subscribes on the roulette spin event.
 /// </summary>
 /// <param name="roulette">The roulette for subscription.</param>
 public void Subscribe(Roulette roulette)
 {
     roulette.rouletteSpine += SendMessageOnRouletteSpin;
 }
 public Roulette Update(string Id, Roulette roulette)
 {
     roulette.idRoulette = Id;
     return(Save(roulette));
 }
Exemple #6
0
 public async Task InsertRoulette(Roulette roulette) =>
 await _context.Roulettes.InsertOneAsync(roulette);
Exemple #7
0
 private void Start()
 {
     roulette = GameManager.GetComponent <Roulette>();
 }
 public void Insert(Roulette roulette)
 {
     Collection.InsertOne(roulette);
 }
Exemple #9
0
 /// <summary>
 /// Unregister
 /// </summary>
 /// <param name="roulette"></param>
 public void Unregister(Roulette roulette)
 {
     roulette.RouletteSpin -= Msg;
 }
Exemple #10
0
        public Roulette CreateRoullete()
        {
            Roulette roulette = new Roulette();

            return(_rouletteRepository.Add(roulette));
        }
Exemple #11
0
 /// <summary>
 /// Register
 /// </summary>
 /// <param name="roulette"></param>
 public void Register(Roulette roulette)
 {
     roulette.RouletteSpin += Msg;
 }
Exemple #12
0
 /// <summary>
 /// Open the roulette
 /// </summary>
 /// <param name="roulette"></param>
 /// <returns></returns>
 public async Task <bool> OpenRoulette(Roulette roulette)
 {
     return(await _rouletteService.OpenRoulette(roulette));
 }
Exemple #13
0
        public void FieldNumer()
        {
            var uut = new Roulette(new FakeRandomizerReturn0(), new FakeFieldFactoryGRB());

            Assert.That(uut.GetResult().Number, Is.EqualTo(0));
        }
Exemple #14
0
        public void FieldEven()
        {
            var uut = new Roulette(new FakeRandomizerReturn0(), new FakeFieldFactoryGRB());

            Assert.That(uut.GetResult().Even, Is.EqualTo(true));
        }
Exemple #15
0
 public Roulette Save(Roulette roulette)
 {
     _cachingProvider.Set(Key + roulette.Id, roulette, TimeSpan.FromDays(365));
     return(roulette);
 }
        public Task <Roulette> UpdateRouletteAsync(int id, Roulette roulette)
        {
            var res = _repository.UpdateAsync(id, roulette);

            return(res);
        }
Exemple #17
0
 private async Task <Roulette> RunRoulette(Roulette roulette)
 {
     roulette.WinnerNumber = new Random().Next(0, 36);
     roulette.Color        = (ColorType) new Random().Next(1, 2);
     return(await _rouletteRepository.UpdateRoulette(roulette));
 }
 public void Update(Roulette roulette)
 {
     Collection.ReplaceOne(r => r.Id == roulette.Id, roulette);
 }
Exemple #19
0
 public void UpdateRoulette(Roulette roulette)
 {
 }
 public Roulette Save(Roulette roulette)
 {
     cachingProvider.Set(KEYREDIS + roulette.idRoulette, roulette, TimeSpan.FromDays(365));
     return(roulette);
 }
 public async Task Add(Roulette roulette)
 {
     await this._context.Roulettes.InsertOneAsync(session : this._context.Session, document : roulette);
 }
Exemple #22
0
 public async Task UpdateRoulette(Roulette newRoulette) =>
 await _context.Roulettes
 .ReplaceOneAsync(roulette => roulette.Id == newRoulette.Id, newRoulette);
 public async Task Update(string id, Roulette roulette)
 {
     await this._context.Roulettes.ReplaceOneAsync(session : this._context.Session, filter : r => r.Id == id, replacement : roulette);
 }
Exemple #24
0
        public ActionResult CreateRoulette()
        {
            Roulette rouletteinstance = _rouletteService.CreateRoullete();

            return(Ok(rouletteinstance.Id));
        }
Exemple #25
0
        public bool OpenRoulette(Roulette roulette)
        {
            ValidateOpenRoulette(rouleteId: roulette.Id);

            return(Create(roulette: roulette));
        }
Exemple #26
0
 /// <summary>
 /// Unsubscribes on the roulette spin event.
 /// </summary>
 /// <param name="roulette">The roulette for unsubscription.</param>
 public void Unsubscribe(Roulette roulette)
 {
     roulette.rouletteSpine -= SendMessageOnRouletteSpin;
 }
Exemple #27
0
        private bool Create(Roulette roulette)
        {
            string rouletteJson = JsonConvert.SerializeObject(roulette);

            return(repository.Post(hashKey: RouletteKey, fieldKey: roulette.Id.ToString(), value: rouletteJson));
        }
Exemple #28
0
    /**
     * @param currentEvent is the event received from the smart object
     * check if currentEvent is equal to the type of event that I expect
     */
    public void checkEvent(EventObject currentEvent)
    {
        lastRoueletteState = rouletteState;
        roulette           = GameObject.Find("Box8").GetComponent <Roulette>();
        rouletteState      = roulette.getState();

        if (rouletteState != 0)
        {
            desiredEventType = defineCategoryForState(rouletteState);
        }
        else
        {
            desiredEventType = 0;
        }
        //int desiredEventType = 2;



        if (desiredEventType == 0)
        {
            // I don't have a desired event to check
            return;
        }

        if (currentEvent.getDuration() != null)
        {
            //if duration=0 it is the first event of the sensor
            return;
        }
        else
        {
            switch (desiredEventType)
            {
            case 1:
                //hold the dolphin for 5 second
                conditionVerified = checkHoldDolphin(currentEvent);
                break;

            case 2:
                //cuddle the dolphin 3 times

                conditionVerified = checkCuddleDolphin(currentEvent);
                break;

            case 3:
                // RFID food
                conditionVerified = checkRfidFood(currentEvent);
                break;

            case 4:
                //RFID hygiene
                conditionVerified = checkRfidHygiene(currentEvent);
                break;

            case 5:
                //RFID entertainment
                conditionVerified = checkRfidEnterteinment(currentEvent);
                break;

            case 6:
                //RFID sleep
                conditionVerified = checkRfidSleep(currentEvent);
                break;
            }

            if (conditionVerified)
            {
                Debug.Log("Condition verified");


                if (desiredEventType != 2 & desiredEventType != 1)
                {
                    roulette.showRight(0);//0
                    roulette.playRight();
                    //CALL TO MIRKO'S CODE
                    ChoiceManager choiceManager = GameObject.Find("ChoiceManager").GetComponent <ChoiceManager>();
                    choiceManager.GenerateObjectsInWorld(rouletteState);
                }
                else
                {
                    if (desiredEventType == 2)
                    {
                        roulette.showRight(2); //2
                        roulette.playRight();
                    }
                    if (desiredEventType == 1)
                    {
                        roulette.showRight(1);//1
                        roulette.playRight();
                    }

                    //roulette.stopRoulette();
                    StartCoroutine(Wait());
                }
            }
            else
            {
                //if (currentEvent.getID() == TOUCH_SENSOR_CUDDLE && desiredEventType == 2)
                if (cuddleCount != 0)
                {
                    roulette.playRight();
                }
                else
                {
                    Debug.Log("Condition not verified");
                    if (desiredEventType == 1 && (currentEvent.getID() == TOUCH_SENSOR_CUDDLE | currentEvent.getID() == TOUCH_SENSOR_HOLD))
                    {
                        roulette.playRight();
                    }
                    else
                    {
                        roulette.playWrong();
                        roulette.showWrong();
                    }
                    if (desiredEventType == 2)
                    {
                        ProgressIndicator.Instance.SetProgress(0f);
                    }
                }
            }
        }
    }
        public async Task <Roulette> CreateRouletteAsync(Roulette roulette)
        {
            var resultado = await _repository.AddAsync(roulette);

            return(resultado);
        }
Exemple #30
0
 private void InitializeSeparatorLins()
 {
     var bestSeparator = new BestSeparator<MKT_Point>();
     var roulette = new Roulette<MKT_Point>();
     var tournament = new Tournament<MKT_Point>();
     var rang = new Rang<MKT_Point>();
     bestSeparatorName = bestSeparator.GetType().Name;
     separators = new Dictionary<string, ISeparator<MKT_Point>>
     {
         {bestSeparatorName, bestSeparator},
         {roulette.GetType().Name, roulette},
         {tournament.GetType().Name, tournament},
         {rang.GetType().Name, rang}
     };
 }
Exemple #31
0
 public async Task <ResultGameDTO> CreateRoulettesAsync([FromBody] Roulette roulette)
 {
     return(await iRoulette.CreateRoulettesAsync(roulette));
 }