Sakuno.KanColle.Amatsukaze.Game.Services.Records.ResourcesRecords.ResourcesRecords C# (CSharp) Method

ResourcesRecords() private method

private ResourcesRecords ( SQLiteConnection rpConnection ) : System
rpConnection System.Data.SQLite.SQLiteConnection
return System
        internal ResourcesRecords(SQLiteConnection rpConnection) : base(rpConnection)
        {
            DisposableObjects.Add(ApiService.Subscribe("api_port/port", r =>
            {
                var rMaterials = KanColleGame.Current.Port.Materials;

                var rShouldInsertRecord =
                    r_Fuel != rMaterials.Fuel ||
                    r_Bullet != rMaterials.Bullet ||
                    r_Steel != rMaterials.Steel ||
                    r_Bauxite != rMaterials.Bauxite ||
                    r_InstantConstruction != rMaterials.InstantConstruction ||
                    r_Bucket != rMaterials.Bucket ||
                    r_DevelopmentMaterial != rMaterials.DevelopmentMaterial ||
                    r_ImprovementMaterial != rMaterials.ImprovementMaterial;

                if (rShouldInsertRecord)
                {
                    r_Fuel = rMaterials.Fuel;
                    r_Bullet = rMaterials.Bullet;
                    r_Steel = rMaterials.Steel;
                    r_Bauxite = rMaterials.Bauxite;
                    r_InstantConstruction = rMaterials.InstantConstruction;
                    r_Bucket = rMaterials.Bucket;
                    r_DevelopmentMaterial = rMaterials.DevelopmentMaterial;
                    r_ImprovementMaterial = rMaterials.ImprovementMaterial;

                    InsertRecord(r.Timestamp);
                }
            }));
        }