-
-
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.
- Loading branch information
Showing
34 changed files
with
539 additions
and
187 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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 | ||
}; | ||
} | ||
} |
Oops, something went wrong.