public void BossPlayTime(BossType type, TimeSpan value) { #if ANDROID _preferencesEditor.PutString("BossPlayTime-" + type.ToString(), value.TotalSeconds.ToString()); _preferencesEditor.Apply(); #endif }
public void BossAttempts(BossType type, int value) { #if ANDROID _preferencesEditor.PutInt("BossAttempts-" + type.ToString(), value); _preferencesEditor.Apply(); #endif }
// Boss specific data public void BossBeatenCounter(BossType type, int value) { #if ANDROID _preferencesEditor.PutInt("BossBeatenCounter-" + type.ToString(), value); _preferencesEditor.Apply(); #endif }
public int BossAttempts(BossType type) { #if ANDROID return(_preferences.GetInt("BossAttempts-" + type.ToString(), 0)); #else return(0); #endif }
public int BossBeatenCounter(BossType type) { #if ANDROID return(_preferences.GetInt("BossBeatenCounter-" + type.ToString(), 0)); #else return(0); #endif }
private void OpenBossPanel(BossType bossType) { _selectedBoss = bossType; var spriterGuiButton = _bossButtons[bossType]; spriterGuiButton.SubstituteEntity.EnableSynchronization(false); var ballPosition = Game.ViewportAdapter.Center.ToVector2(); ballPosition.Y -= 575; spriterGuiButton.Animator().Position = ballPosition; spriterGuiButton.Animator().Scale = new Vector2(2f); spriterGuiButton.Animator().ZIndex(11); foreach (var bossPanelButton in _bossPanelButtons) { Game.GuiManager.AddButton(bossPanelButton); } foreach (var bossPanelLabel in _bossPanelLabels) { Game.GuiManager.AddLabel(bossPanelLabel); } Game.SpriteBatchManager.AddSpriterAnimator(SpriterFile["BossPanel"], Layer.UI); SpriterFile["BossPanel"].Play("Show"); // Update labels var bossDeath = Game.PlayerData.BossBeatenCounter(bossType); _bossNameLabel.Text = "Xmas " + bossType.ToString().Substring(4); _bestTimeLabel.Text = "Best time: "; _bestTimeLabel.Text += (bossDeath > 0) ? Game.PlayerData.BossBestTime(bossType).ToString("mm\\:ss") : "--:--"; _playTimeLabel.Text = "Play time: " + Game.PlayerData.BossPlayTime(bossType).ToString("mm\\:ss"); _playerDeathLabel.Text = "Attempts: " + (Game.PlayerData.DeathCounter(bossType) + Game.PlayerData.BossBeatenCounter(bossType)).ToString("000"); _bossDeathLabel.Text = "Boss deaths: " + bossDeath; DoOpenBossPanel(); }
public TimeSpan BossPlayTime(BossType type) { return(TimeSpan.FromSeconds(_preferences.GetFloat("BossPlayTime-" + type.ToString(), 0))); }
public void BossPlayTime(BossType type, TimeSpan value) { _preferences.Editor().PutFloat("BossPlayTime-" + type.ToString(), (float)value.TotalSeconds); _preferences.Editor().Apply(); }
public int DeathCounter(BossType type) { return(_preferences.GetInt("DeathCounter-" + type.ToString(), 0)); }
public void DeathCounter(BossType type, int value) { _preferences.Editor().PutInt("DeathCounter-" + type.ToString(), value); _preferences.Editor().Apply(); }
public TimeSpan BossBestTime(BossType type) { #if ANDROID return(TimeSpan.FromSeconds(double.Parse(_preferences.GetString("BossBestTime-" + type.ToString(), "0")))); #else return(TimeSpan.Zero); #endif }