diff --git a/ArkSavegameToolkitNet.Domain/ArkPlayer.cs b/ArkSavegameToolkitNet.Domain/ArkPlayer.cs index d66b755..345d5ea 100644 --- a/ArkSavegameToolkitNet.Domain/ArkPlayer.cs +++ b/ArkSavegameToolkitNet.Domain/ArkPlayer.cs @@ -106,12 +106,12 @@ public ArkPlayer() _creatures = new Lazy(() => { ArkTamedCreature[] creatures = null; - return _gameData._playerTamedCreatures.TryGetValue(Id, out creatures) ? creatures : new ArkTamedCreature[] { }; + return _gameData?._playerTamedCreatures.TryGetValue(Id, out creatures) == true ? creatures : new ArkTamedCreature[] { }; }); _structures = new Lazy(() => { ArkStructure[] structures = null; - return _gameData._playerStructures.TryGetValue(Id, out structures) ? structures : new ArkStructure[] { }; + return _gameData?._playerStructures.TryGetValue(Id, out structures) == true ? structures : new ArkStructure[] { }; }); _items = new Lazy(() => Structures.SelectMany(x => x.Inventory) .Concat(Creatures.SelectMany(x => x.Inventory)) @@ -122,28 +122,28 @@ public ArkPlayer() _tribe = new Lazy(() => { ArkTribe tribe = null; - return _gameData._playerTribes.TryGetValue(Id, out tribe) ? tribe : null; + return _gameData?._playerTribes.TryGetValue(Id, out tribe) == true ? tribe : null; }); _inventory = new Lazy(() => { if (!InventoryId.HasValue) return new ArkItem[] { }; ArkItem[] items = null; - return _gameData._inventoryItems.TryGetValue(InventoryId.Value, out items) ? items.Where(ArkItem.Filter_RealItems).ToArray() : new ArkItem[] { }; + return _gameData?._inventoryItems.TryGetValue(InventoryId.Value, out items) == true ? items.Where(ArkItem.Filter_RealItems).ToArray() : new ArkItem[] { }; }); _cloudCreatures = new Lazy(() => { ArkCloudInventoryDino[] creatures = null; - return _clusterData._playerCloudCreatures.TryGetValue(SteamId, out creatures) ? creatures : new ArkCloudInventoryDino[] { }; + return _clusterData?._playerCloudCreatures.TryGetValue(SteamId, out creatures) == true ? creatures : new ArkCloudInventoryDino[] { }; }); _cloudItems = new Lazy(() => { ArkCloudInventoryItem[] items = null; - return _clusterData._playerCloudItems.TryGetValue(SteamId, out items) ? items : new ArkCloudInventoryItem[] { }; + return _clusterData?._playerCloudItems.TryGetValue(SteamId, out items) == true ? items : new ArkCloudInventoryItem[] { }; }); _lastActiveTime = new Lazy(() => { ArkCloudInventory inv = null; - return _clusterData._playerCloudInventories.TryGetValue(SteamId, out inv) && inv.SavedAt > SavedAt ? inv.SavedAt : SavedAt; + return _clusterData?._playerCloudInventories.TryGetValue(SteamId, out inv) == true && inv.SavedAt > SavedAt ? inv.SavedAt : SavedAt; }); } diff --git a/ArkSavegameToolkitNet.Domain/ArkStructure.cs b/ArkSavegameToolkitNet.Domain/ArkStructure.cs index 78c261a..5326adb 100644 --- a/ArkSavegameToolkitNet.Domain/ArkStructure.cs +++ b/ArkSavegameToolkitNet.Domain/ArkStructure.cs @@ -46,7 +46,7 @@ public ArkStructure() if (!InventoryId.HasValue) return new ArkItem[] { }; ArkItem[] items = null; - return _gameData._inventoryItems.TryGetValue(InventoryId.Value, out items) ? items.Where(ArkItem.Filter_RealItems).ToArray() : new ArkItem[] { }; + return _gameData?._inventoryItems.TryGetValue(InventoryId.Value, out items) == true ? items.Where(ArkItem.Filter_RealItems).ToArray() : new ArkItem[] { }; }); } diff --git a/ArkSavegameToolkitNet.Domain/ArkTamedCreature.cs b/ArkSavegameToolkitNet.Domain/ArkTamedCreature.cs index f2af058..12b99f5 100644 --- a/ArkSavegameToolkitNet.Domain/ArkTamedCreature.cs +++ b/ArkSavegameToolkitNet.Domain/ArkTamedCreature.cs @@ -270,7 +270,7 @@ private void Construct() if (!InventoryId.HasValue) return new ArkItem[] { }; ArkItem[] items = null; - return _gameData._inventoryItems.TryGetValue(InventoryId.Value, out items) ? items.Where(ArkItem.Filter_RealItems).ToArray() : new ArkItem[] { }; + return _gameData?._inventoryItems.TryGetValue(InventoryId.Value, out items) == true ? items.Where(ArkItem.Filter_RealItems).ToArray() : new ArkItem[] { }; }); } diff --git a/ArkSavegameToolkitNet.Domain/ArkTribe.cs b/ArkSavegameToolkitNet.Domain/ArkTribe.cs index cca8046..a6319ef 100644 --- a/ArkSavegameToolkitNet.Domain/ArkTribe.cs +++ b/ArkSavegameToolkitNet.Domain/ArkTribe.cs @@ -52,12 +52,12 @@ public ArkTribe() _creatures = new Lazy(() => { ArkTamedCreature[] creatures = null; - return _gameData._tribeTamedCreatures.TryGetValue(Id, out creatures) ? creatures : new ArkTamedCreature[] { }; + return _gameData?._tribeTamedCreatures.TryGetValue(Id, out creatures) == true ? creatures : new ArkTamedCreature[] { }; }); _structures = new Lazy(() => { ArkStructure[] structures = null; - return _gameData._tribeStructures.TryGetValue(Id, out structures) ? structures : new ArkStructure[] { }; + return _gameData?._tribeStructures.TryGetValue(Id, out structures) == true ? structures : new ArkStructure[] { }; }); _items = new Lazy(() => Structures.SelectMany(x => x.Inventory) .Concat(Creatures.SelectMany(x => x.Inventory)).Where(ArkItem.Filter_RealItems).ToArray()); @@ -67,7 +67,7 @@ public ArkTribe() _members = new Lazy(() => { ArkPlayer[] members = null; - return _gameData._tribePlayers.TryGetValue(Id, out members) ? members : new ArkPlayer[] { }; + return _gameData?._tribePlayers.TryGetValue(Id, out members) == true ? members : new ArkPlayer[] { }; }); _lastActiveTime = new Lazy(() => Members.Length > 0 ? Members.Max(y => y.LastActiveTime) : SavedAt); } diff --git a/ArkSavegameToolkitNet.Domain/Properties/AssemblyInfo.cs b/ArkSavegameToolkitNet.Domain/Properties/AssemblyInfo.cs index bf28d67..564ae3c 100644 --- a/ArkSavegameToolkitNet.Domain/Properties/AssemblyInfo.cs +++ b/ArkSavegameToolkitNet.Domain/Properties/AssemblyInfo.cs @@ -32,8 +32,8 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyFileVersion("1.3.0.0")] //todo: temp for dev purposes [assembly: InternalsVisibleTo("ArkSavegameToolkitNet.TestConsoleApp")] \ No newline at end of file diff --git a/ArkSavegameToolkitNet/Properties/AssemblyInfo.cs b/ArkSavegameToolkitNet/Properties/AssemblyInfo.cs index 96e9c84..9d3507d 100644 --- a/ArkSavegameToolkitNet/Properties/AssemblyInfo.cs +++ b/ArkSavegameToolkitNet/Properties/AssemblyInfo.cs @@ -32,7 +32,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyFileVersion("1.3.0.0")] [assembly: InternalsVisibleTo("ArkSavegameToolkitNet.Domain")] \ No newline at end of file