예제 #1
0
        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;
            }
        }
예제 #2
0
        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);
        }