diff --git a/Blazor/Blazor/Components/Inventory.razor b/Blazor/Blazor/Components/Inventory.razor
index c02d63c..e711bf1 100644
--- a/Blazor/Blazor/Components/Inventory.razor
+++ b/Blazor/Blazor/Components/Inventory.razor
@@ -5,15 +5,6 @@
@for(int i = 0; i
- }
- else
- {
-
-

-
- }
+
}
\ No newline at end of file
diff --git a/Blazor/Blazor/Components/Inventory.razor.cs b/Blazor/Blazor/Components/Inventory.razor.cs
index cb45dde..5ecc191 100644
--- a/Blazor/Blazor/Components/Inventory.razor.cs
+++ b/Blazor/Blazor/Components/Inventory.razor.cs
@@ -1,15 +1,24 @@
using Blazor.Models;
using Blazor.Pages;
using Microsoft.AspNetCore.Components;
+using System.Collections.ObjectModel;
+
namespace Blazor.Components
{
partial class Inventory
{
+
+ public Inventory()
+ {
+ Actions = new ObservableCollection();
+ }
+ public ObservableCollection Actions { get; set; }
[Parameter]
public InventoryList inventory { get; set; }
-
public void Add(Item item)
+ /*peut être useless*/
{
+ if (item == null) return;
foreach(InventoryItem element in inventory.inventoryItems)
{
if(item.Id == element.item.Id)
@@ -17,11 +26,13 @@ namespace Blazor.Components
if(element.Stack == element.item.StackSize)
{
addEnd(item);
+ this.StateHasChanged();
return;
}
else
{
element.Stack += 1;
+ this.StateHasChanged();
return;
}
}
@@ -29,6 +40,7 @@ namespace Blazor.Components
{
element.item = item;
element.Stack = 1;
+ this.StateHasChanged();
return;
}
}
@@ -36,6 +48,7 @@ namespace Blazor.Components
}
public void addEnd(Item item)
+ /*peut être useless*/
{
int i = 0;
while (inventory.inventoryItems[i]!=null)
diff --git a/Blazor/Blazor/Components/InventoryAction.cs b/Blazor/Blazor/Components/InventoryAction.cs
new file mode 100644
index 0000000..746e0f2
--- /dev/null
+++ b/Blazor/Blazor/Components/InventoryAction.cs
@@ -0,0 +1,11 @@
+using Blazor.Models;
+
+namespace Blazor.Components
+{
+ public class InventoryAction
+ {
+ public string Action { get; set; }
+ public int Index { get; set; }
+ public Item Item { get; set; }
+ }
+}
diff --git a/Blazor/Blazor/Components/ItemInventory.razor b/Blazor/Blazor/Components/ItemInventory.razor
index 9053490..56d5c4a 100644
--- a/Blazor/Blazor/Components/ItemInventory.razor
+++ b/Blazor/Blazor/Components/ItemInventory.razor
@@ -1,3 +1,19 @@
- @items.item
+ @if(items != null)
+ {
+ @if(!string.IsNullOrWhiteSpace(items.item.ImageBase64))
+ {
+
)
+ }
+ else
+ {
+

+ }
+ }
+ else
+ {
+
+

+
+ }
\ No newline at end of file
diff --git a/Blazor/Blazor/Components/ItemInventory.razor.cs b/Blazor/Blazor/Components/ItemInventory.razor.cs
index 92b0953..c1ad38e 100644
--- a/Blazor/Blazor/Components/ItemInventory.razor.cs
+++ b/Blazor/Blazor/Components/ItemInventory.razor.cs
@@ -7,5 +7,8 @@ namespace Blazor.Components
{
[Parameter]
public InventoryItem items { get; set; }
+
+ [Parameter]
+ public int index { get; set; }
}
}
diff --git a/Blazor/Blazor/Components/ItemInventory.razor.css b/Blazor/Blazor/Components/ItemInventory.razor.css
deleted file mode 100644
index b2d4521..0000000
--- a/Blazor/Blazor/Components/ItemInventory.razor.css
+++ /dev/null
@@ -1,6 +0,0 @@
-.item {
- width: 64px;
- height: 64px;
- border: 1px solid;
- overflow: hidden;
-}