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)); }
public void RunBeforeTests() { _uut = new Roulette(new FakeRandomize(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)); }
public async Task InsertRoulette(Roulette roulette) => await _context.Roulettes.InsertOneAsync(roulette);
private void Start() { roulette = GameManager.GetComponent <Roulette>(); }
public void Insert(Roulette roulette) { Collection.InsertOne(roulette); }
/// <summary> /// Unregister /// </summary> /// <param name="roulette"></param> public void Unregister(Roulette roulette) { roulette.RouletteSpin -= Msg; }
public Roulette CreateRoullete() { Roulette roulette = new Roulette(); return(_rouletteRepository.Add(roulette)); }
/// <summary> /// Register /// </summary> /// <param name="roulette"></param> public void Register(Roulette roulette) { roulette.RouletteSpin += Msg; }
/// <summary> /// Open the roulette /// </summary> /// <param name="roulette"></param> /// <returns></returns> public async Task <bool> OpenRoulette(Roulette roulette) { return(await _rouletteService.OpenRoulette(roulette)); }
public void FieldNumer() { var uut = new Roulette(new FakeRandomizerReturn0(), new FakeFieldFactoryGRB()); Assert.That(uut.GetResult().Number, Is.EqualTo(0)); }
public void FieldEven() { var uut = new Roulette(new FakeRandomizerReturn0(), new FakeFieldFactoryGRB()); Assert.That(uut.GetResult().Even, Is.EqualTo(true)); }
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); }
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); }
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); }
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); }
public ActionResult CreateRoulette() { Roulette rouletteinstance = _rouletteService.CreateRoullete(); return(Ok(rouletteinstance.Id)); }
public bool OpenRoulette(Roulette roulette) { ValidateOpenRoulette(rouleteId: roulette.Id); return(Create(roulette: roulette)); }
/// <summary> /// Unsubscribes on the roulette spin event. /// </summary> /// <param name="roulette">The roulette for unsubscription.</param> public void Unsubscribe(Roulette roulette) { roulette.rouletteSpine -= SendMessageOnRouletteSpin; }
private bool Create(Roulette roulette) { string rouletteJson = JsonConvert.SerializeObject(roulette); return(repository.Post(hashKey: RouletteKey, fieldKey: roulette.Id.ToString(), value: rouletteJson)); }
/** * @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); }
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} }; }
public async Task <ResultGameDTO> CreateRoulettesAsync([FromBody] Roulette roulette) { return(await iRoulette.CreateRoulettesAsync(roulette)); }