private void LoadTransfersDefinitions() { transfersDefinitions = new Dictionary <int, TransfersDefinition>(); ResourceDataFile fileReader = new ResourceDataFile(@"Data/Transfer"); int count = fileReader.ReadInt(); for (int i = 0; i < count; i++) { TransfersDefinition def = TransfersDefinition.ReadFromFile(fileReader); transfersDefinitions[def.DefinitionId] = def; } }
public static TransfersDefinition ReadFromFile(ResourceDataFile reader) { TransfersDefinition def = new TransfersDefinition(); def.DefinitionId = reader.ReadInt(); def.Transfers = new List <TransferDefinition>(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { TransferDefinition transfer = TransferDefinition.ReadFromFile(reader); transfer.DefinitionId = def.DefinitionId; } return(def); }