private void UpdateView() { TitlePanelPresenter.SetCoinsValue(PlayerDataModel.GetCoins()); TitlePanelPresenter.SetGemsValue(PlayerDataModel.GetGems()); TitlePanelPresenter.SetTicketsValue(PlayerDataModel.GetTickets()); TitlePanelPresenter.SetXpValue(PlayerDataModel.GetXp()); TitlePanelPresenter.SetLevelValue(PlayerDataModel.GetLevel()); }
public void AddXp(int Value) { if (PlayerDataModel.GetXp() + Value > GetNextLevelXp()) { PlayerDataModel.SetXp(PlayerDataModel.GetXp() + Value - GetNextLevelXp()); SetLevel(PlayerDataModel.GetLevel()); } else { PlayerDataModel.SetXp(Value); } TitlePanelPresenter.SetXpValue(PlayerDataModel.GetXp()); }
private int GetNextLevelXp() { return(Mathf.RoundToInt(PlayerDataModel.GetLevel() * 0.5f)); }
private void SetLevel(int Value) { PlayerDataModel.SetLevel(Value); TitlePanelPresenter.SetLevelValue(PlayerDataModel.GetLevel()); }