public PlayerData(SlotPanelData inventoryPanel, SlotPanelData equipmentPanel, PlayerStatData playerStats, TransformData transformData) { this.inventoryPanel = inventoryPanel; this.equipmentPanel = equipmentPanel; this.playerStats = playerStats; this.transformData = transformData; }
//유저 스탯 테이블 init. public void InitUserStatTable() { var bro = Backend.GameData.GetMyData("UserStatTable", new Where(), 10); string OwnerIndate = ""; if (bro.IsSuccess() == false) { // 요청 실패 처리 Debug.Log(bro); return; } if (bro.GetReturnValuetoJSON()["rows"].Count <= 0) { // 요청이 성공해도 where 조건에 부합하는 데이터가 없을 수 있기 때문에 // 데이터가 존재하는지 확인 // 위와 같은 new Where() 조건의 경우 테이블에 row가 하나도 없으면 Count가 0 이하 일 수 있다. Debug.Log(bro); return; } //내 테이블의 rowindate 할당. for (int i = 0; i < bro.Rows().Count; ++i) { OwnerIndate = bro.Rows()[i]["inDate"]["S"].ToString(); } string[] select = { "Attack", "AttackSpeed", "MovingSpeed", "Hp", "Leadership", "Appeal", "owner_inDate" }; // 테이블 내 해당 rowIndate를 지닌 row를 조회 // select에 존재하는 컬럼만 리턴 var BRO = Backend.GameData.Get("UserStatTable", OwnerIndate, select); //BackEnd Return 데이터 Get. var json = BRO.GetReturnValuetoJSON(); //BackEnd Return 데이터 => JSON 데이터로 변환 playerStat = new PlayerStatData(json); //PlayerData 클래스에 할당. StatTableKey = OwnerIndate; }
public PlayerStatData SaveStats() { PlayerStatData psd = new PlayerStatData(); psd.experience = baseStats.currentExperience; psd.level = baseStats.level; return(psd); }
public PlayerStatData SavePlayerStats(PlayerStats _playerStats) { var saveData = new PlayerStatData(_playerStats.CurrentLevel, _playerStats.CurrentXP); saveData.currentLevel = _playerStats.CurrentLevel; saveData.currentXP = _playerStats.CurrentXP; return(saveData); }
public IEnumerator Init(GameStatistics gameStatistics) { m_allies.Clear(); m_opponents.Clear(); m_availableStats.Clear(); RepeatedField <GameStatistics.Types.PlayerStats> playerStats = gameStatistics.PlayerStats; for (int i = 0; i < playerStats.get_Count(); i++) { GameStatistics.Types.PlayerStats playerStats2 = playerStats.get_Item(i); for (int j = 0; j < playerStats2.Titles.get_Count(); j++) { FightStatType item = (FightStatType)playerStats2.Titles.get_Item(j); if (!m_availableStats.Contains(item)) { m_availableStats.Add(item); } } if (GameStatus.GetFightStatus(playerStats2.FightId).TryGetEntity(playerStats2.PlayerId, out PlayerStatus entityStatus) && entityStatus.heroStatus != null) { PlayerStatData playerStatData = default(PlayerStatData); playerStatData.name = entityStatus.nickname; playerStatData.weaponDefinition = (WeaponDefinition)entityStatus.heroStatus.definition; playerStatData.playerStats = playerStats2; PlayerStatData item2 = playerStatData; if (GameStatus.localPlayerTeamIndex == entityStatus.teamIndex) { item2.ally = true; m_allies.Add(item2); } else { item2.ally = false; m_opponents.Add(item2); } } } PlayerStatDataComparer comparer = new PlayerStatDataComparer(); m_allies.Sort(comparer); m_opponents.Sort(comparer); if (GameStatus.fightType == FightType.TeamVersus) { m_teamScoreLine.get_gameObject().SetActive(true); m_allyTeamScore.SetText(GameStatus.allyTeamPoints.ToString()); m_opponentTeamScore.SetText(GameStatus.opponentTeamPoints.ToString()); } else { m_teamScoreLine.get_gameObject().SetActive(false); } bool displayOpponent = m_opponents.Count > 0 || GameStatus.fightType != FightType.BossFight; m_versusImage.get_gameObject().SetActive(displayOpponent); m_versusBloom.get_gameObject().SetActive(displayOpponent); yield return(m_playerLine.Init(m_allies, m_opponents, displayOpponent)); m_statLines[0].Init(m_allies, m_opponents, FightStatType.TotalDamageDealt, displayOpponent); m_statLines[1].Init(m_allies, m_opponents, FightStatType.TotalDamageSustained, displayOpponent); m_statLines[2].Init(m_allies, m_opponents, FightStatType.PlayTime, displayOpponent); m_statLines[3].Init(m_allies, m_opponents, FightStatType.TotalKills, displayOpponent); InitOptionnalLine(m_statLines[4], FightStatType.CompanionGiven, displayOpponent); InitOptionnalLine(m_statLines[5], FightStatType.BudgetPointsDiff, displayOpponent); InitOptionnalLine(m_statLines[6], FightStatType.BudgetPointsWon, displayOpponent); }
public void LoadStats(PlayerStatData playerStatData) { baseStats.currentExperience = playerStatData.experience; baseStats.level = playerStatData.level; }
public void LoadPlayerStats(PlayerStats _playerStats, PlayerStatData playerStatsData) { _playerStats.Load(playerStatsData); }