public async Task <ActionResult <Playing> > PostPlaying(Playing playing) { _context.Playing.Add(playing); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPlaying", new { id = playing.Id }, playing)); }
public async Task <IActionResult> PutPlaying(int id, Playing playing) { if (id != playing.Id) { return(BadRequest()); } _context.Entry(playing).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void StopPlayback() { foreach (NAudio.Wave.WasapiOut Playing in this.CurrentlyPlaying) { Playing.Stop(); } }
public string History(string type) { if (type == "Chip") { return(Chiping.History()); } else if (type == "DentalCare") { return(Dental.History()); } else if (type == "Fitness") { return(FitnessPr.History()); } else if (type == "NailTrim") { return(NailJob.History()); } else if (type == "Play") { return(Playing.History()); } else { return(Vaccine.History()); } }
/// <summary> /// 更新回合 /// </summary> public void UpdateBout() { if (playing == Playing.None) { UpdateGameData(); playing = Playing.OnRed; } else if (playing == Playing.OnRed) { playing = Playing.RedAdding; } else if (playing == Playing.RedAdding) { UpdateGameData(); playing = Playing.OnBlack; } else if (playing == Playing.OnBlack) { playing = Playing.BlackAdding; } else if (playing == Playing.BlackAdding) { UpdateGameData(); playing = Playing.OnRed; } }
// Update is called once per frame public void Run() { switch (GameState) { case GameStates.States.Starting: Starting.Invoke(); break; case GameStates.States.Loading: Loading.Invoke(); break; case GameStates.States.Playing: Playing.Invoke(); break; case GameStates.States.Dying: Dying.Invoke(); break; case GameStates.States.Ending: Ending.Invoke(); break; } }
void OnPlaying(ref LibVlcEventArgs eventArgs, IntPtr userData) { if (Playing != null) { Playing.Invoke(this, new EventArgs()); } }
public void Init() { _timer.Tick += (object sender, object e) => { Playing?.Invoke(); }; }
public async Task PlayAudioStream(Stream audioStream, CancellationToken token = default) { try { Playing?.Invoke(this, true); await semaphore.WaitAsync(token); using var pump = new PortAudioDevicePump(OutputDevice, 2, outputFormat, OutputDevice.DefaultLowOutputLatency, 48000, ReadCallback); using var handle = new ManualResetEventSlim(false); pump.StreamFinished += FinishedHandler; pump.Start(); handle.Wait(); pump.StreamFinished -= FinishedHandler; int ReadCallback(byte[] buffer, int offset, int count) => audioStream.Read(buffer, offset, count); void FinishedHandler(object sender, EventArgs eventArgs) => handle.Set(); } catch (OperationCanceledException) { } finally { if (semaphore.CurrentCount == 0) { semaphore.Release(); } Playing?.Invoke(this, false); } }
void RunStates() //Command will loop either state because switch is in update { switch (GameState) { case "Starting": Starting.Invoke(); break; //stop and get out of the switch block case "Loading": Loading.Invoke(); break; //stop and get out of the switch block case "Dying": Dying.Invoke(); break; //stop and get out of the switch block case "Playing": Playing.Invoke(); break; //stop and get out of the switch block case "Ending": Ending.Invoke(); break; //stop and get out of the switch block } }
public async Task <IActionResult> Edit(int id, [Bind("PlayingId,TimeSlotId,PlayingDate,MovieId,RoomId")] Playing playing) { if (id != playing.PlayingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(playing); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PlayingExists(playing.PlayingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MovieId"] = new SelectList(_context.Movie, "MovieId", "MovieId", playing.MovieId); ViewData["RoomId"] = new SelectList(_context.Room, "RoomId", "RoomId", playing.RoomId); ViewData["TimeSlotId"] = new SelectList(_context.TimeSlot, "TimeSlotId", "TimeSlotId", playing.TimeSlotId); return(View(playing)); }
public Task Play(MediaItem channel) { if (!(channel is AtscMedia)) { return(Task.CompletedTask); } var atsc = channel as AtscMedia; var tuningSpaces2 = new SystemTuningSpaces(); var tuningSpaces = (ITuningSpaceContainer) new SystemTuningSpaces(); var atscTuningSpace = new ATSCTuningSpace { NetworkType = "{0DAD2FDD-5FD7-11D3-8F50-00C04F7971E2}", CountryCode = 1, MaxChannel = 999, MaxMinorChannel = 99, UniqueName = "ATSC" }; var tuneRequest = (IATSCChannelTuneRequest)atscTuningSpace.CreateTuneRequest(); var locator = new ATSCLocator { PhysicalChannel = 19 }; tuneRequest.Channel = 19; tuneRequest.MinorChannel = 1; tuneRequest.Locator = (Locator)locator; var objTuneRequest = (object)tuneRequest; video.axMSVidCtl1.View(ref objTuneRequest); video.axMSVidCtl1.Run(); Playing?.Invoke(this, null); return(Task.CompletedTask); }
public void PlayAudio(byte instrument, byte note) { if (Samples[instrument] == null) { return; } Audio audio = Samples[instrument][note]; if (audio == null) { return; } audio.Cancel = false; audio.State = Audio.ADSR.Attack; audio.Position = 0; if (!Playing.Contains(audio)) { Playing.Add(audio); } if (Player == null) { Player = new Thread(RunAudioThread); Player.Start(); } }
// Update is called once per frame public void Run() { switch (GameState) { case "Starting": Starting.Invoke(); break; case "Dying": Dying.Invoke(); break; case "Playing": Playing.Invoke(); break; case "Ending": Ending.Invoke(); break; case "Winning": Winning.Invoke(); break; } }
public void changeGameState(string newState) { switch (newState) { case "playing": { playing = new Playing(spriteBatch, this); state.leaving(); state = playing; state.entering(); break; } case "initialize": { init = new Initializer(spriteBatch, this); state.leaving(); state = init; state.entering(); break; } case "title": { title = new TitleCard(spriteBatch, this); state.leaving(); state = title; state.entering(); break; } } }
public List <PieceOfData> Classify(List <PieceOfData> data) { foreach (var d in data) { var playing = false; var notPlaying = false; if (Playing.Any(item => item.Compare(d))) { playing = true; } else if (NotPlaying.Any(item => item.Compare(d))) { notPlaying = true; } if ((playing && notPlaying) || (!playing && !notPlaying)) { d.Play = "unknown"; } else if (playing) { d.Play = "yes"; } else if (notPlaying) { d.Play = "no"; } } return(data); }
public void StateObjectTransitionEnumStateMachineEngineTest_HandleStateTransition_PlayingStop_ReturnsStopped() { var currentState = new Playing(); var transition = Transitions.Stop; var expectedStateType = typeof(Stopped); this.AssertHandleStateTransitionResult(currentState, transition, expectedStateType); }
/// <summary> /// 重置游戏数据 /// </summary> public static void ResetGame() { IsBattle = false; step = 0; gameStatus = GameStatus.NotBegin; playing = Playing.None; GameCache.ClearCache(); }
/// <summary> /// 复盘模式时游戏处理 /// </summary> public static void ReplayModeGame() { IsBattle = false; step = 0; gameStatus = GameStatus.Replay; playing = Playing.None; CreateManager.Instance.InitChessBoard(); }
public Task NotifyPlaying() { if (Playing != null) { return(Playing.Invoke()); } return(Task.CompletedTask); }
public Event(Scene scene, Playing playing, TextBox textBox, int id, string tag, string command) { this.scene = scene; this.playing = playing; this.textBox = textBox; this.id = id; this.tag = tag; this.command = command; }
public Transition(Playing playing, Scene scene, SpriteBatch spriteBatch, SpriteFont symbols,Texture2D topFade, Texture2D bottomFade) { this.bottomFade = bottomFade; this.topFade = topFade; this.symbols = symbols; this.spriteBatch = spriteBatch; this.playing = playing; this.scene = scene; }
protected virtual void OnPlaying(Hero playerOne, Hero playerTwo, double playerOneAT, double playerTwoDF) { Playing?.Invoke(this, new PlayingEventArgs() { PlayerOne = playerOne, PlayerTwo = playerTwo, PlayerOneAT = playerOneAT, PlayerTwoDF = playerTwoDF }); }
/// <summary> /// コマンド・バッファーから1行読取り。 /// </summary> public void ReadCommandBuffer(Playing playing, StringBuilder hyoji) { if (0 < playing.commandBuffer.Count) { commandline = playing.commandBuffer[0]; caret = 0; playing.commandBuffer.RemoveAt(0); hyoji.AppendLine(commandline); } }
private void OnPlaying() { if (_playingHandler != null) { if (_schedule?.NowPlaying != null) { Playing?.Invoke(this, EventArgs.Empty); } _playingHandler.PostDelayed(OnPlaying, 500); } }
public string Play(string name, int procedureTime) { if (Hotel.Animals.ContainsKey(name)) { Playing.DoService(Hotel.Animals[name], procedureTime); return($"{name} was playing for {procedureTime} hours"); } else { throw new ArgumentException($"ArgumentException: Animal {name} does not exist"); } }
/// <summary> /// 次の入力を促す表示をしてるだけだぜ☆(^~^) /// </summary> public void ShowPrompt(Playing playing, FenSyurui f, StringBuilder hyoji) { if (0 < playing.commandBuffer.Count) { // コマンド・バッファーの実行中だぜ☆(^▽^) hyoji.Append($"{playing.commandBufferName }> "); Logger.Flush(hyoji); } else if (GameMode.Game == PureAppli.gameMode) { // 表示(コンソール・ゲーム用) 局面、あれば勝敗☆(^~^) { if (this.isKyokumenEcho1) { SpkBan_1Column.Setumei_NingenGameYo(PureMemory.kifu_endTeme, hyoji); //#if DEBUG // CommandK.Ky(isSfen, "ky fen", gky, syuturyoku);// 参考:改造FEN表示 // CommandS.Move_cmd(isSfen, "move", gky, syuturyoku);// 参考:指し手表示 // if (false){ // SpkShogiban.HyojiKomanoIbasho(gky.ky.shogiban, syuturyoku);// 参考:駒の表示 // SpkShogiban.HyojiKomanoKikiSu(gky.ky.shogiban, syuturyoku);// 参考:利きの数 // } // CommandS.Move_cmd(isSfen, "move seisei", gky, syuturyoku);// 参考:指し手表示 詳細 // Util_Machine.Flush(syuturyoku); //#endif playing.Result(hyoji, CommandMode.NingenYoConsoleGame); } Logger.Flush(hyoji); } if (!playing.isMultipleLineCommand // 複数行コマンド読み取り中はプロンプトを出さないぜ☆(^~^) && (PureMemory.kifu_teban == Taikyokusya.T1 && !PureSettei.p1Com) || (PureMemory.kifu_teban == Taikyokusya.T2 && !PureSettei.p2Com) ) { // 人間の手番が始まるところで☆ hyoji.Append(@"指し手を入力してください。一例 do B3B2 ※ do b3b2 も同じ > "); Logger.Flush(hyoji); } } else { // 表示(コンソール・ゲーム用) hyoji.Append("> "); Logger.Flush(hyoji); } }
internal int GetPlayerIndex(string player) { if (!Players.Contains(player)) { Players.Add(player); ClassEdit.Add("none"); Arenas.Add("none"); Playing.Add("none"); Preview.Add(false); Backups.Add(null); } return(Players.FindIndex(p => p == player)); }
public void Run() { Player p = new Player(); PlayerState ps = new Playing(p); p.Next(); p.Next(); p.Prev(); p.StopPlay(); // p.StartPlay(); // p.Lock(); // p.Play(); }
public async Task <IActionResult> Create([Bind("PlayingId,TimeSlotId,PlayingDate,MovieId,RoomId")] Playing playing) { if (ModelState.IsValid) { _context.Add(playing); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["MovieId"] = new SelectList(_context.Movie, "MovieId", "MovieId", playing.MovieId); ViewData["RoomId"] = new SelectList(_context.Room, "RoomId", "RoomId", playing.RoomId); ViewData["TimeSlotId"] = new SelectList(_context.TimeSlot, "TimeSlotId", "TimeSlotId", playing.TimeSlotId); return(View(playing)); }
private void OnTriggerExit2D(Collider2D collision) { if (collision.CompareTag("Player")) { pingSound.Stop(); pingCount--; if (pingCount == 0) { playing = Playing.None; } } }
public void Reset() { HandCards = new List <Card>(); _Balance = 0; _IsPlaying = Playing.Undecided; _WantToPlay = false; _WantToPlayAnswered = false; _AnnouncedGameType = GameType.Ramsch; _AnnouncedColor = Color.None; Spectators = new List <PlayerState>(); _SpectatorsWaitingForApproval = new Queue <PlayerState>(); IsRunaway = false; _HasBeenAskedToOfferMarriage = false; _HasAnsweredMarriageOffer = false; }
private async Task Start(string id) { await Queue.AddSongToQueue(Context, id); if (Database.Read("Music", "Server_ID", Context.Guild.Id.ToString(), "Playing") != "True") { IAudioClient AudioClient = await Channel.ConnectAsync(); Playing.StartPlaying(AudioClient, Context, Channel); } else { await Context.Channel.SendMessageAsync("The bot is already playing something but i added your song to the Queue"); } }
public ingameMenu(RogueLike ingame, SpriteFont output, Playing playing) { this.playing = playing; this.ingame = ingame; this.output = output; }
public Scene(Playing playing, TextBox textBox) { this.textBox = textBox; this.playing = playing; this.constructor = new Constructor(string.Format("Level{0}.csv", level)); dimensions = constructor.getDimensions(); string[] ioArray = File.ReadAllText(string.Format("Content//Level{0}Event.csv", level)).Split('\n'); triggerArray = new int[(ioArray[0].Length + 1) / 2, ioArray.GetLength(0)]; for (int i = 0; i < ioArray.Length; i++) { string[] lineSplit = ioArray[i].Split(','); for (int j = 0; j < lineSplit.Length; j++) { triggerArray[j, i] = Convert.ToInt16(lineSplit[j]); } } processXML("jail", level); }
public Paused(Playing playing, ingameMenu menu) { this.playing = playing; this.menu = menu; this.tag = "Paused"; }
public Enemy(int[] coords, Scene scene, int health, string drop, int eventId, string tag, Playing playing, bool aggressive, string uniVal, int speed) { //Debug.Print(uniVal); this.speed = speed; this.setTag(tag); this.coords = coords; this.scene = scene; this.playing = playing; this.color = Playing.getColor("White"); this.health = health; this.uniVal = char.ConvertFromUtf32(Convert.ToInt32(uniVal)); this.drop = drop; this.eventId = eventId; this.aggressive = aggressive; dying = false; }
public Player(int[] coords, Scene scene, Playing playing) { this.playing = playing; this.color = Playing.getColor("White"); inventory.Add("fist"); this.coords = coords; this.scene = scene; }
//9604 , 9607 , 9749 (table? public StaticObject(int[] coords, string icon, string type, string collision, string particles, int frequency, string color, Playing playing, int[] pixMod, bool destructible, bool solid, int particleLife) { this.particleLife = particleLife; this.solid = solid; this.destructible = destructible; this.pixMod = pixMod; this.coords = coords; this.icon = char.ConvertFromUtf32(Convert.ToInt32(icon)); this.playing = playing; this.color = Playing.getColor(color); //this.icon = "\u25B2"; this.type = type; this.collision = collision == "true"; this.particles = particles; this.frequency = frequency; }
private static void PlayNew() { DisposeAudio(); Option = Playing.Init; if (FileExists) { _gFile = new GetFile(); _gFile.Loaded +=_gFile_Loaded; _waveStream = _gFile.Wave(FilePath); _audioChannel32 = new WaveChannel32(_waveStream) {PadWithZeroes = false}; _iWavePlayer.Init(_audioChannel32); _iWavePlayer.PlaybackStopped += _waveOut_PlaybackStopped; } else { _gStream = new GetStream(); _gStream.EnoughDataToPlay +=_gStream_EnoughDataToPlay; _waveStream = _gStream.Wave(Url); _audioChannel32 = new WaveChannel32(_waveStream) {PadWithZeroes = false}; _iWavePlayer.Init(_audioChannel32); _iWavePlayer.PlaybackStopped += _waveOut_PlaybackStopped; } _audioChannel32.Volume = DefaultDevice.AudioEndpointVolume.MasterVolumeLevelScalar; _iWavePlayer.Play(); }
private static void _gFile_Loaded(object sender, EventArgs e) { Option = Playing.Ready; }
public Unpaused(Playing playing, Scene scene, Player player, List<Enemy> enemies, List<Item> items, List<Particle> particles, List<Projectile> projectiles, TextBox textBox, List<Box> boxes, List<StaticObject> staticObjects) { this.playing = playing; this.player = player; this.enemies = enemies; this.projectiles = projectiles; this.items = items; this.particles = particles; this.scene = scene; this.textBox = textBox; this.boxes = boxes; this.staticObjects = staticObjects; this.tag = "Unpaused"; }
private static void _gStream_EnoughDataToPlay(object sender, EventArgs e) { Option = Playing.Ready; }