public TrainingRecord(FlyableShipType trainingShipType, byte[] bytes, int nextTrainingLevelOffset, int trainingScoreOffset, int trainingCompletedOffset) { TrainingShipType = trainingShipType; NextTrainingLevel = bytes[nextTrainingLevelOffset]; TrainingScore = BitConverter.ToUInt32(bytes, trainingScoreOffset); TrainingLevelCompleted = bytes[trainingCompletedOffset]; }
public TrainingRecord(FlyableShipType trainingShipType) { TrainingShipType = trainingShipType; NextTrainingLevel = 0; TrainingScore = 0; TrainingLevelCompleted = 0; }
public void WriteData(FlyableShipType playerShip, byte[] bytes) { switch (playerShip) { case FlyableShipType.XWing: bytes[134] = (byte)TrainingCompleted; TrainingScore.CopyToByteArrayLE(bytes, 38); break; case FlyableShipType.YWing: bytes[135] = (byte)TrainingCompleted; TrainingScore.CopyToByteArrayLE(bytes, 42); break; case FlyableShipType.AWing: bytes[136] = (byte)TrainingCompleted; TrainingScore.CopyToByteArrayLE(bytes, 46); break; case FlyableShipType.BWing: bytes[137] = (byte)TrainingCompleted; TrainingScore.CopyToByteArrayLE(bytes, 50); break; } }
public HistoricCombatRecord(FlyableShipType missionType, byte[] bytes, int numberOfMissions, int missionCompletedOffset, int missionScoreOffset) { MissionType = missionType; MissionComplete = new List <bool>(numberOfMissions); MissionScore = new List <uint>(numberOfMissions); for (int i = 0; i < numberOfMissions; i++) { MissionComplete.Add(Convert.ToBoolean(bytes[missionCompletedOffset + i])); MissionScore.Add(BitConverter.ToUInt32(bytes, missionScoreOffset + (i * 4))); } }
public HistoricCombatRecord(FlyableShipType missionType, int numberOfMissions) { MissionType = missionType; MissionComplete = new List <bool>(numberOfMissions); MissionScore = new List <uint>(numberOfMissions); for (int i = 0; i < numberOfMissions; i++) { MissionComplete.Add(false); MissionScore.Add(0); } }
public void WriteData(FlyableShipType playerShip, byte[] bytes) { switch (playerShip) { case FlyableShipType.TF: bytes[29] = (byte)NextTrainingLevel; bytes[90] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 42); break; case FlyableShipType.TI: bytes[30] = (byte)NextTrainingLevel; bytes[91] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 46); break; case FlyableShipType.TB: bytes[31] = (byte)NextTrainingLevel; bytes[92] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 50); break; case FlyableShipType.TA: bytes[32] = (byte)NextTrainingLevel; bytes[93] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 54); break; case FlyableShipType.GUN: bytes[33] = (byte)NextTrainingLevel; bytes[94] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 58); break; case FlyableShipType.TD: bytes[34] = (byte)NextTrainingLevel; bytes[95] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 62); break; case FlyableShipType.MB: bytes[35] = (byte)NextTrainingLevel; bytes[96] = (byte)TrainingLevelCompleted; TrainingScore.CopyToByteArrayLE(bytes, 66); break; } }
public TrainingRecord(FlyableShipType trainingShipType) { TrainingShipType = trainingShipType; TrainingScore = 0; TrainingCompleted = 0; }