public XboxHistory() { Action updates = new Action(() => { Log.Logger = new LoggerConfiguration() .WriteTo.Console(theme: AnsiConsoleTheme.Code) .WriteTo.Seq("http://localhost:5341") .CreateLogger(); try { var previousSeason = ""; var currentSeason = ""; var savePrevious = ""; Console.WriteLine("Updating Historical Statistics"); previousSeason = Utilities.GetPrevious("xbox"); currentSeason = Utilities.GetSeason("xbox"); savePrevious = ""; Console.WriteLine("Updating Xbox Historical Statistics"); for (int i = int.Parse(previousSeason); i < int.Parse(currentSeason); i++) { //PlayerEngine.GetField("xbox", "playerstats", i, "pre", "uh"); //GoalieEngine.GetGoalie("xbox", "goaliestats", i, "pre", "uh"); //Log.Logger.Warning("Xbox Goalies pre updated\n"); //Log.CloseAndFlush(); //TeamEngine.GetTeam("xbox", "teamstats", i, "pre", "uh"); PlayerEngine.GetField("xbox", "playerstats", i, "reg", "uh"); Log.Logger.Warning("Xbox Players updated\n"); Log.CloseAndFlush(); GoalieEngine.GetGoalie("xbox", "goaliestats", i, "reg", "uh"); Log.Logger.Warning("Xbox Goalies updated.\n"); Log.CloseAndFlush(); TeamEngine.GetTeam("xbox", "teamstats", i, "reg", "uh"); Console.WriteLine($"Xbox Stats saved for: {i} [Historical]"); Log.CloseAndFlush(); savePrevious = i.ToString(); //Console.WriteLine($"--->{previousSeason}\n---->{i}"); } Console.WriteLine(!Utilities.SavePrevious("xbox", savePrevious) ? "Failed to update Xbox Previous Season" : "Successfully updated Xbox previous season."); Console.WriteLine("Historical Stats Updated."); } catch (Exception ex) { Log.Logger.Error($"Fatal error running historical stats update.\n{ex}"); Console.WriteLine($"Fatal error running historical stats update.\n{ex}"); } }); this.Schedule(updates).ToRunNow().AndEvery(1).Days().At(15, 0); }
#pragma warning restore private void Awake() { _myEngine = GetComponent <PlayerEngine>(); _myAnim = GetComponentInChildren <Animator>(); _myWeapon = GetComponentInChildren <PlayerFireWeapon>(); _myMovement = GetComponent <PlayerMovement>(); }
private void Start() { Instance = this; player = FindObjectOfType <PlayerEngine>(); if (!player) { Debug.Log("There is no player in this scene."); return; } target = player.transform; xDeg = transform.eulerAngles.x; Cursor.visible = false; Cursor.lockState = CursorLockMode.Locked; for (int i = 0; i < states.Length; i++) { states[i].Init(target, collisionLayer, transform); } aggroTime = states[1].CombatDuration; StartCameraBehindPlayer(); player.OnAttackedPressed += PlayerAttacked; CoreHealth.Instance.coreDied += GameOver; }
private void Update() { if (Time.timeScale.Equals(0)) { return; } #if UNITY_EDITOR Vector2 directionalInput = new Vector2(Input.GetAxisRaw(HORIZONTAL_AXIS), Input.GetAxisRaw(VERTICAL_AXIS)); #else Vector2 directionalInput = new Vector2(Input.acceleration.x, Input.acceleration.y); #endif PlayerEngine.SetDirectionalInput(directionalInput); if (Input.GetMouseButtonDown(0)) { if (!UIManager.Instance.IsOverUIElement) { PlayerEngine.OnJumpInputDown(); } } if (Input.GetMouseButtonUp(0)) { PlayerEngine.OnJumpInputUp(); } }
public PsnHistory() { Action updates = new Action(() => { Log.Logger = new LoggerConfiguration() .WriteTo.Console(theme: AnsiConsoleTheme.Code) .WriteTo.Seq("http://localhost:5341") .CreateLogger(); var previousSeason = ""; var currentSeason = ""; var savePrevious = ""; try { previousSeason = Utilities.GetPrevious("psn"); currentSeason = Utilities.GetSeason("psn"); savePrevious = ""; Console.WriteLine("Updating PSN Historical Statistics"); for (int i = int.Parse(previousSeason); i < int.Parse(currentSeason); i++) { //Console.WriteLine($"We are inside the f*****g loop (iteration {i})."); //PlayerEngine.GetField("psn", "playerstats", i, "pre", "uh"); //Log.Logger.Warning("PSN Players pre updated."); //Log.CloseAndFlush(); //GoalieEngine.GetGoalie("psn", "goaliestats", i, "pre", "uh"); //Log.Logger.Warning("PSN Goalies pre updated."); //Log.CloseAndFlush(); ////eamEngine.GetTeam("psn", "teamstats", i, "pre", "uh"); PlayerEngine.GetField("psn", "playerstats", i, "reg", "uh"); Log.Logger.Warning("PSN Players pre updated."); Log.CloseAndFlush(); GoalieEngine.GetGoalie("psn", "goaliestats", i, "reg", "uh"); Log.Logger.Warning("PSN Goalies pre updated."); Log.CloseAndFlush(); //TeamEngine.GetTeam("psn", "teamstats", i, "reg", "uh"); Console.WriteLine($"PSN Stats saved for: {i} [Historical]\n"); Log.CloseAndFlush(); savePrevious = i.ToString(); //Console.WriteLine($"--->{previousSeason}\n---->{i}"); } Console.WriteLine(!Utilities.SavePrevious("psn", savePrevious) ? "Failed to update PSN Previous Season" : "Successfully updated PSN previous season."); } catch (Exception ex) { Log.Logger.Error($"Fatal error running historical stats update.\n{ex}"); Console.WriteLine($"Fatal error running historical stats update.\n{ex}"); } }); this.Schedule(updates).ToRunNow().AndEvery(1).Months().OnTheSecond(DayOfWeek.Friday); }
void Awake() { mentalGuage = maxMentalGuage; engine = GetComponent<PlayerEngine>(); animator = GetComponent<Animator>(); lastDamagedTime = Time.time - immuneDelay - 1.0f; }
void Start() { aiPath = GetComponent <AIPath>(); coolDown = 2f; countDown = coolDown; strExp = PlayerEngine.FindNextLevelExpRequirement(strLvl); }
private void Start() { monsters = FindObjectsOfType <MonsterAI>(); player = FindObjectOfType <PlayerEngine>(); currentSanity = maxSanity + 1; sanityBar.SetMaxSanity(maxSanity); sanModifier = false; }
void Update() { health.GetComponent <Text>().text = pHealth.ToString() + " / " + pHealthLevel.ToString(); if (pHealth <= 0) { AIPath aiPath = GetComponent <AIPath>(); aiPath.canMove = false; StrengthSkill strSkill = GetComponent <StrengthSkill>(); StrengthSkill.clickOnEnemy = false; StrengthSkill.strAtt = false; strSkill.ePos = null; DefenseSkill defSkill = GetComponent <DefenseSkill>(); DefenseSkill.clickOnEnemy = false; DefenseSkill.defAtt = false; defSkill.ePos = null; MagicSkill.magTar = null; pHealth = Mathf.RoundToInt(0.5f * pHealthLevel); transform.position = new Vector3(-0.087f, -6.31f, 0f); aiPath.target = transform; aiPath.canMove = false; //for (int i = 0; i < pHealth; i++) // heart[i].GetComponent<SpriteRenderer>().color = new Color(255, 255, 255, 255); theDM.dLines = new string[1]; theDM.dLines[0] = "You have died and respawned back at the village. You have lost 100 coins."; theDM.currentLine = 0; theDM.ShowDialog(); StartCoroutine(WaitForDeath()); PlayerEngine pEng = GetComponent <PlayerEngine>(); pEng.RespawnPlayer(); } if (countDown <= coolDown) { countDown += Time.deltaTime; if (healSpellButton != null) { healSpellButton.GetComponentInChildren <Text>().text = (25 - countDown).ToString("0.00"); } } else if (healSpellButton != null) { healSpellButton.GetComponentInChildren <Text>().text = "Ready"; } }
private void Start() { pEngine = GetComponent <PlayerEngine>(); if (!cam) { Debug.LogError("System need a camera in order to work !"); this.enabled = false; return; } }
void Start() { player = FindObjectOfType <PlayerEngine>(); monsterPos = gameObject.transform.position; nav = GetComponent <NavMeshAgent>(); InitializeNodeCache(); // GoToNode(ClosestNode()); currentNode = ClosestNode(); GoToNode(currentNode); }
public BansheePlayerData(PlayerEngine source) { if (!(source is IVisualizationDataSource)) { throw new ArgumentException("source is not an IVisualizationDataSource"); } this.mSource = source; this.Active = true; }
void Start() { pEng = FindObjectOfType <PlayerEngine>(); click = FindObjectOfType <ClickTarget>(); if (pEng.startingPointName == pointName) { pEng.gameObject.transform.position = transform.position; click.gameObject.transform.position = pEng.gameObject.transform.position; } }
private void OnDisable() { PlayerEngine player = FindObjectOfType <PlayerEngine>(); if (player) { player.OnPlayerDeath -= PlayerDied; player.OnPlayerRespawn -= PlayerRespawned; } }
protected override void Start() { base.Start(); player = GetComponent <PlayerEngine>(); useDuration = animations[USE_OBJECT].Count; currentUseStep = 0; jumpDuration = animations[JUMP].Count; currentJumpStep = 0; }
public override void Interact(GameObject user) { base.Interact(user); narrationText.DisplayText("Office Hours are over.", 5); PlayerEngine ps = user.GetComponent <PlayerEngine>(); if (ps) { ps.WinGame(); } }
void Awake() { //heart = hearts; //for (int i = 0; i < pHealth; i++) // heart[i].SetActive(true); pHealthExp = PlayerEngine.FindNextLevelExpRequirement(pHealthLevel); theDM = FindObjectOfType <DialogManager>(); StartCoroutine(HealBackHealth()); countDown = coolDown; }
public static void CraftingGiveExp(float exp) { if (PlayerEngine.MaxLevel(craftLvl)) { return; } craftExp += exp; Debug.Log("Crafting Exp: " + craftExp); if (craftExp >= PlayerEngine.FindNextLevelExpRequirement(craftLvl + 1)) { CraftingLevel(); } }
void MiningGiveExp(float exp) { if (PlayerEngine.MaxLevel(mineLvl)) { return; } mineExp += exp; Debug.Log("Mining Exp: " + mineExp); if (mineExp >= PlayerEngine.FindNextLevelExpRequirement(mineLvl + 1)) { MiningLevel(); } }
protected void UpdateHealth() { if (txHealth != null && GameManager.instance != null && GameManager.instance.levelManager != null) { GameObject player = GameObject.FindGameObjectWithTag("Player"); int value = 0; if (player != null) { PlayerEngine playerEngine = player.GetComponent <PlayerEngine>(); value = playerEngine.currentHp; } txHealth.text = value.ToString(); } }
//Gives exp depending on spell cast void MagicGiveExp(int exp) { if (PlayerEngine.MaxLevel(magLvl)) { return; } magExp += exp * 4; Debug.Log("Magic Exp: " + magExp); if (magExp >= PlayerEngine.FindNextLevelExpRequirement(magLvl + 1)) { MagicLevel(); } }
//Gives exp depending on dmg done void DefenseGiveExp(int exp) { if (PlayerEngine.MaxLevel(defLvl)) { return; } defExp += exp * 4; Debug.Log("Defense Exp: " + defExp); if (defExp >= PlayerEngine.FindNextLevelExpRequirement(defLvl + 1)) { DefenseLevel(); } }
//Gives exp depending on dmg done void StrengthGiveExp(int exp) { if (PlayerEngine.MaxLevel(strLvl)) { return; } strExp += exp * 4; Debug.Log("Strength Exp: " + strExp); if (strExp >= PlayerEngine.FindNextLevelExpRequirement(strLvl + 1)) { StrengthLevel(); } }
public override void OnEnter(string oldState) { Sm.IsMouseVisible = true; skyplaneEngine = P.GetEngine <SkyplaneEngine>("skyplaneEngine"); playerEngine = P.GetEngine <PlayerEngine>("playerEngine"); interfaceEngine = P.GetEngine <InterfaceEngine>("interfaceEngine"); particleEngine = P.GetEngine <ParticleEngine>("particleEngine"); drawRect = new Rectangle(Sm.GraphicsDevice.Viewport.Width / 2 - 1024 / 2, Sm.GraphicsDevice.Viewport.Height / 2 - 768 / 2, 1024, 1024); //_P.KillPlayer(""); }
private void ConnectOrDisconnect(PlayerEngine engine, bool connect) { var vis_engine = engine as IVisualizationDataSource; if (vis_engine != null) { if (connect) { vis_engine.DataAvailable += OnVisualizationDataAvailable; } else { vis_engine.DataAvailable -= OnVisualizationDataAvailable; } } }
public PlayListsViewModel() { this.FileSearchWorker = new FileSearchWorker("PlayList", MediaFile.GetMediaFileViewModel); var container = TinyIoCContainer.Current; this.playerEngine = container.Resolve <PlayerEngine>(); this.playerSettings = container.Resolve <PlayerSettings>(); this.SelectedPlayListFiles = new ObservableCollection <IMediaFile>(); this.StartUpCommand = ReactiveCommand.CreateAsyncTask(x => this.StartUpAsync()); // handle command line args from another instance this.WhenAnyValue(x => x.CommandLineArgs) .Where(list => list != null && list.Skip(1).Any()) .Select(list => list.Skip(1).ToList()) .SelectMany(list => this.HandleCommandLineArgsAsync(list).ToObservable()) .Subscribe(); }
private void Start() { mainCamera = GetComponent <CameraController>(); if (!deathCameraStart || !deathCameraEnd) { Debug.LogWarning("No death cameras assigned"); return; } deathCameraStart.enabled = false; PlayerEngine player = FindObjectOfType <PlayerEngine>(); if (player) { player.OnPlayerDeath += PlayerDied; player.OnPlayerRespawn += PlayerRespawned; } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { pEng = FindObjectOfType <PlayerEngine>(); pEng.startingPointName = exitPoint; pEng.GetComponent <AIPath>().target = pEng.transform; click = FindObjectOfType <ClickTarget>(); click.transform.position = pEng.transform.position; click.gameObject.SetActive(false); //pEng.gameObject.GetComponent<AIPath>().enabled = false; uiControl.whichScene(loadLevel); uiControl.StartFade(false); //pEng.gameObject.GetComponent<AIPath>().enabled = true; click.gameObject.SetActive(true); pEng.GetComponent <AIPath>().target = pEng.transform; click.transform.position = pEng.transform.position; } }
private int gameType = 0; //Denna ändras till 4 för klassisk eller 5 för styrd. #endregion #region Constructor public CreateGameViewModel() { dbOps = new DbOperations(); playerEngine = new PlayerEngine(); SelectedPlayers = new ObservableCollection <Player>(); AvailablePlayer = new Player(); AvailablePlayers = new ObservableCollection <Player>(); nav = new NavigationViewModel(); ClassicGameCommand = new RelayCommand(ClassicGame, CanChooseClassicYatzy); StyrdGameCommand = new RelayCommand(StyrdGame, CanChooseStyrdYatzy); AddPlayerCommand = new RelayCommand(AddPlayer, CanAddPlayer); RemovePlayerCommand = new RelayCommand(RemovePlayer, CanRemovePlayer); StartGameCommand = new RelayCommand(StartGame, CanStartGame); BackCommand = new RelayCommand(Backcommand, CanExecuteMethod); AddNewPlayerCommand = new RelayCommand(AddNewPlayer, CanAddNewPlayer); AvailablePlayer = null; GetAvaliablePlayers(); }
void Start() { magExp = PlayerEngine.FindNextLevelExpRequirement(magLvl); countDown = coolDown; if (magLvl >= 5) { waterButton.GetComponent <Button>().enabled = true; Color c = new Color(255, 255, 255, 255); waterButton.GetComponent <Image>().color = c; waterButton.GetComponentInChildren <SpriteRenderer>().enabled = false; waterButton.GetComponentInChildren <Text>().text = ""; } if (magLvl >= 15) { earthButton.GetComponent <Button>().enabled = true; Color c = new Color(255, 255, 255, 255); earthButton.GetComponent <Image>().color = c; earthButton.GetComponentInChildren <SpriteRenderer>().enabled = false; earthButton.GetComponentInChildren <Text>().text = ""; } if (magLvl >= 20) { fireButton.GetComponent <Button>().enabled = true; Color c = new Color(255, 255, 255, 255); fireButton.GetComponent <Image>().color = c; fireButton.GetComponentInChildren <SpriteRenderer>().enabled = false; fireButton.GetComponentInChildren <Text>().text = ""; } if (magLvl >= 25) { healButton.GetComponent <Button>().enabled = true; Color c = new Color(255, 255, 255, 255); healButton.GetComponent <Image>().color = c; healButton.GetComponentInChildren <SpriteRenderer>().enabled = false; healButton.GetComponentInChildren <Text>().text = ""; } }
public DicesViewModel(PlayerEngine _playerEngine) { Player = new Player(); playerEngine = _playerEngine; dbOps = new DbOperations(); random = new Random(); gameType = playerEngine.SetGameType(); ActivePlayers = playerEngine.SetPlayers(); ActivePlayer = playerEngine.SetActivePlayer(); GenerateDices(); GetGameEngine(); DiceImages(); SetWarningTimer(); SetEndTimer(); pgv = new PlayGameView(0); count = 0; throwsLeft = 3; gameEnded = false; SetThrowsLeft(throwsLeft); SaveDiceCommand = new RelayCommand(SaveDice, CanSaveDices); RollDicesCommand = new RelayCommand(RollDices, IsTriesEnabled); Ones = new RelayCommand(ChooseScoreCategory, IsOnesEnabled); Twos = new RelayCommand(ChooseScoreCategory, IsTwosEnabled); Threes = new RelayCommand(ChooseScoreCategory, IsThreesEnabled); Fours = new RelayCommand(ChooseScoreCategory, IsFoursEnabled); Fives = new RelayCommand(ChooseScoreCategory, IsFivesEnabled); Sixes = new RelayCommand(ChooseScoreCategory, IsSixesEnabled); Pair = new RelayCommand(ChooseScoreCategory, IsPairEnabled); TwoPair = new RelayCommand(ChooseScoreCategory, IsTwoPairEnabled); Threeofakind = new RelayCommand(ChooseScoreCategory, IsThreeOfaKindEnabled); Fourofakind = new RelayCommand(ChooseScoreCategory, IsFourOfaKindEnabled); Smallstraight = new RelayCommand(ChooseScoreCategory, IsSmalLadderEnabled); Largestraight = new RelayCommand(ChooseScoreCategory, IsLargeLadderEnabled); Fullhouse = new RelayCommand(ChooseScoreCategory, IsFullHouseEnabled); Chance = new RelayCommand(ChooseScoreCategory, IsChanceEnabled); Yatzy = new RelayCommand(ChooseScoreCategory, IsYatzyEnabled); QuitGameCommand = new RelayCommand(QuitGame, CanExecuteMethod); }
void Start() { healthMgr = transform.parent.GetComponent<IHealth>(); engine=transform.parent.GetComponent<PlayerEngine>(); nextFireTime=Time.time; }
void Start() { player = (PlayerEngine)FindObjectOfType(typeof(PlayerEngine)); }
internal Visualization(PlayerEngine.AudioSinkBin audiobin) { // The basic pipeline we're constructing is: // .audiotee ! queue ! audioresample ! audioconvert ! fakesink Element converter, resampler; Element audiosinkqueue; Pad pad; vis_buffer = null; vis_fft = new Gst.FFT.FFTF32 (SLICE_SIZE * 2, false); vis_fft_buffer = new GstFFTF32Complex [SLICE_SIZE + 1]; vis_fft_sample_buffer = new float [SLICE_SIZE]; // Core elements, if something fails here, it's the end of the world audiosinkqueue = ElementFactory.Make ("queue", "vis-queue"); pad = audiosinkqueue.GetStaticPad ("sink"); pad.AddProbe (PadProbeType.EventDownstream, EventProbe); resampler = ElementFactory.Make ("audioresample", "vis-resample"); converter = ElementFactory.Make ("audioconvert", "vis-convert"); Element fakesink = ElementFactory.Make ("fakesink", "vis-sink"); if (audiosinkqueue == null || resampler == null || converter == null || fakesink == null) { Log.Debug ("Could not construct visualization pipeline, a fundamental element could not be created"); return; } //http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-queue.html#GstQueueLeaky const int GST_QUEUE_LEAK_DOWNSTREAM = 2; // Keep around the 5 most recent seconds of audio so that when resuming // visualization we have something to show right away. audiosinkqueue ["leaky"] = GST_QUEUE_LEAK_DOWNSTREAM; audiosinkqueue ["max-size-buffers"] = 0; audiosinkqueue ["max-size-bytes"] = 0; audiosinkqueue ["max-size-time"] = ((long)Constants.SECOND) * 5L; fakesink.Connect ("handoff", PCMHandoff); // This enables the handoff signal. fakesink ["signal-handoffs"] = true; // Synchronize so we see vis at the same time as we hear it. fakesink ["sync"] = true; // Drop buffers if they come in too late. This is mainly used when // thawing the vis pipeline. fakesink ["max-lateness"] = ((long)Constants.SECOND / 120L); // Deliver buffers one frame early. This allows for rendering // time. (TODO: It would be great to calculate this on-the-fly so // we match the rendering time. fakesink ["ts-offset"] = -((long)Constants.SECOND / 60L); // Don't go to PAUSED when we freeze the pipeline. fakesink ["async"] = false; audiobin.Add (audiosinkqueue, resampler, converter, fakesink); pad = audiosinkqueue.GetStaticPad ("sink"); Pad teepad = audiobin.RequestTeePad (); teepad.Link (pad); teepad.Dispose (); pad.Dispose (); Element.Link (audiosinkqueue, resampler, converter); converter.LinkFiltered (fakesink, caps); vis_buffer = new Adapter (); vis_resampler = resampler; vis_thawing = false; active = false; }
public async Task InitializePlayback(IVLCMedia media, bool autoPlay) { // First set the player engine // For videos AND music, we have to try first with Microsoft own player // Then we register to Failed callback. If it doesn't work, we set ForceVlcLib to true if (UseVlcLib) _playerEngine = PlayerEngine.VLC; else { var path = ""; if (!string.IsNullOrEmpty(media.Path)) path = Path.GetExtension(media.Path); else if (media.File != null) path = media.File.FileType; if (media is TrackItem) { if (VLCFileExtensions.MFSupported.Contains(path.ToLower())) { #if WINDOWS_PHONE_APP _playerEngine = PlayerEngine.BackgroundMFPlayer; #else _playerEngine = PlayerEngine.VLC; #endif } else { ToastHelper.Basic("This file might not play in background", false, "background"); _playerEngine = PlayerEngine.VLC; _mediaService.Stop(); } } else { _playerEngine = PlayerEngine.VLC; } } // Now, ensure the chosen Player is ready to play something await Locator.MediaPlaybackViewModel._mediaService.PlayerInstanceReady.Task; _mediaService.MediaFailed += _mediaService_MediaFailed; _mediaService.StatusChanged += PlayerStateChanged; _mediaService.TimeChanged += UpdateTime; // Send the media we want to play await _mediaService.SetMediaFile(media); _mediaService.OnLengthChanged += OnLengthChanged; _mediaService.OnStopped += OnStopped; _mediaService.OnEndReached += OnEndReached; _mediaService.OnBuffering += MediaServiceOnOnBuffering; switch (_playerEngine) { case PlayerEngine.VLC: var vlcService = (VLCService)_mediaService; if (vlcService.MediaPlayer == null) return; var em = vlcService.MediaPlayer.eventManager(); em.OnTrackAdded += Locator.MediaPlaybackViewModel.OnTrackAdded; em.OnTrackDeleted += Locator.MediaPlaybackViewModel.OnTrackDeleted; if (!autoPlay) return; vlcService.Play(); break; case PlayerEngine.MediaFoundation: var mfService = (MFService)_mediaService; if (mfService == null) return; if (!autoPlay) return; _mediaService.Play(); break; case PlayerEngine.BackgroundMFPlayer: if (!autoPlay) return; _mediaService.Play(CurrentMedia.Id); break; default: throw new ArgumentOutOfRangeException(); } await App.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => SpeedRate = 100); }