public static BlitzballPlayer GetPlayerInfo(int playerIndex, BlitzballData blitzData) { var techs = new byte[5]; for (int i = 0; i < 5; i++) { techs[i] = blitzData.TechsEquipped[playerIndex * 5 + i]; } var player = new BlitzballPlayer() { Level = blitzData.PlayerLevels[playerIndex], Contract = blitzData.PlayerContracts[playerIndex], Experience = blitzData.PlayerExperience[playerIndex], LeagueGoals = 0, // TODO Implement This Salary = blitzData.PlayerSalary[playerIndex], SkillFlags1 = blitzData.AbilityFlags1[playerIndex], SkillFlags2 = blitzData.AbilityFlags2[playerIndex], TechCapacity = blitzData.TechsAvailable[playerIndex], Techs = techs, TournamentGoals = 0, // TODO Implement This }; return(player); }
public static BlitzballPlayer[] GetPlayers() { var blitzData = ReadBlitzballData(); var players = new BlitzballPlayer[TotalPlayers]; for (int i = 0; i < TotalPlayers; i++) { players[i] = GetPlayerInfo(i, blitzData); } return(players); }
public static void SetPlayerInfo(int playerIndex, BlitzballPlayer playerInfo) { var blitzData = ReadBlitzballData(); blitzData.PlayerLevels[playerIndex] = playerInfo.Level; blitzData.PlayerContracts[playerIndex] = playerInfo.Contract; blitzData.PlayerExperience[playerIndex] = playerInfo.Experience; blitzData.PlayerSalary[playerIndex] = playerInfo.Salary; blitzData.AbilityFlags1[playerIndex] = playerInfo.SkillFlags1; blitzData.AbilityFlags2[playerIndex] = playerInfo.SkillFlags2; blitzData.TechsAvailable[playerIndex] = playerInfo.TechCapacity; Array.Copy(playerInfo.Techs, blitzData.TechsEquipped, 5); WriteBlitzballData(blitzData); }