-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'StorageHistory' into dev
- Loading branch information
Showing
27 changed files
with
457 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
src/StatisticsAnalysisTool/Models/NetworkModel/ContainerItem.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/StatisticsAnalysisTool/StorageHistory/ContainerItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using StatisticsAnalysisTool.Common; | ||
using StatisticsAnalysisTool.Models; | ||
using StatisticsAnalysisTool.ViewModels; | ||
|
||
namespace StatisticsAnalysisTool.StorageHistory; | ||
|
||
public class ContainerItem : BaseViewModel | ||
{ | ||
private int _itemIndex; | ||
private int _quantity; | ||
|
||
public int ItemIndex | ||
{ | ||
get => _itemIndex; | ||
set | ||
{ | ||
_itemIndex = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public int Quantity | ||
{ | ||
get => _quantity; | ||
set | ||
{ | ||
_quantity = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
public Item Item => ItemController.GetItemByIndex(ItemIndex); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/StatisticsAnalysisTool/StorageHistory/ContainerItemDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace StatisticsAnalysisTool.StorageHistory; | ||
|
||
public class ContainerItemDto | ||
{ | ||
[JsonPropertyName("I")] | ||
public int ItemIndex { get; set; } | ||
[JsonPropertyName("Q")] | ||
public int Quantity { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
src/StatisticsAnalysisTool/StorageHistory/StorageHistoryMapping.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
|
||
namespace StatisticsAnalysisTool.StorageHistory; | ||
|
||
public static class StorageHistoryMapping | ||
{ | ||
public static VaultDto Mapping(Vault vault) | ||
{ | ||
return new VaultDto() | ||
{ | ||
Location = vault.Location, | ||
MainLocationIndex = vault.MainLocationIndex, | ||
MapType = vault.MapType, | ||
VaultContainer = vault.VaultContainer.Select(Mapping).ToList() | ||
}; | ||
} | ||
|
||
public static Vault Mapping(VaultDto vaultDto) | ||
{ | ||
return new Vault() | ||
{ | ||
Location = vaultDto.Location, | ||
MainLocationIndex = vaultDto.MainLocationIndex, | ||
MapType = vaultDto.MapType, | ||
VaultContainer = vaultDto.VaultContainer.Select(Mapping).ToList() | ||
}; | ||
} | ||
|
||
public static VaultContainerDto Mapping(VaultContainer vaultContainer) | ||
{ | ||
return new VaultContainerDto() | ||
{ | ||
LastUpdate = vaultContainer.LastUpdate, | ||
Guid = vaultContainer.Guid, | ||
Name = vaultContainer.Name, | ||
Icon = vaultContainer.Icon, | ||
Items = vaultContainer.Items.Select(Mapping).ToList() | ||
}; | ||
} | ||
|
||
public static VaultContainer Mapping(VaultContainerDto vaultContainerDto) | ||
{ | ||
return new VaultContainer() | ||
{ | ||
LastUpdate = vaultContainerDto.LastUpdate, | ||
Guid = vaultContainerDto.Guid, | ||
Name = vaultContainerDto.Name, | ||
Icon = vaultContainerDto.Icon, | ||
Items = new ObservableCollection<ContainerItem>(vaultContainerDto.Items.Select(Mapping)) | ||
}; | ||
} | ||
|
||
public static ContainerItemDto Mapping(ContainerItem containerItem) | ||
{ | ||
return new ContainerItemDto() | ||
{ | ||
ItemIndex = containerItem.ItemIndex, | ||
Quantity = containerItem.Quantity | ||
}; | ||
} | ||
|
||
public static ContainerItem Mapping(ContainerItemDto containerItemDto) | ||
{ | ||
return new ContainerItem() | ||
{ | ||
ItemIndex = containerItemDto.ItemIndex, | ||
Quantity = containerItemDto.Quantity | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using StatisticsAnalysisTool.Cluster; | ||
using StatisticsAnalysisTool.GameFileData; | ||
using StatisticsAnalysisTool.Localization; | ||
using StatisticsAnalysisTool.ViewModels; | ||
using System.Collections.Generic; | ||
|
||
namespace StatisticsAnalysisTool.StorageHistory; | ||
|
||
public class Vault : BaseViewModel | ||
{ | ||
private string _location; | ||
private string _mainLocationIndex; | ||
private MapType _mapType; | ||
private List<VaultContainer> _vaultContainer = new(); | ||
|
||
public string Location | ||
{ | ||
get => _location; | ||
set | ||
{ | ||
_location = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public string MainLocationIndex | ||
{ | ||
get => _mainLocationIndex; | ||
set | ||
{ | ||
_mainLocationIndex = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public MapType MapType | ||
{ | ||
get => _mapType; | ||
set | ||
{ | ||
_mapType = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public List<VaultContainer> VaultContainer | ||
{ | ||
get => _vaultContainer; | ||
set | ||
{ | ||
_vaultContainer = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public string MainLocation => WorldData.GetUniqueNameOrDefault(MainLocationIndex); | ||
|
||
public string LocationDisplayString | ||
{ | ||
get | ||
{ | ||
if (MapType is MapType.Hideout) | ||
{ | ||
return $"{Location} ({LocalizationController.Translation("HIDEOUT")}) - {MainLocation}"; | ||
} | ||
|
||
if (MapType is MapType.Island) | ||
{ | ||
return $"{Location} ({LocalizationController.Translation("ISLAND")})"; | ||
} | ||
|
||
return Location; | ||
} | ||
} | ||
} |
Oops, something went wrong.