diff --git a/.vs/BlazorApp1/DesignTimeBuild/.dtbcache.v2 b/.vs/BlazorApp1/DesignTimeBuild/.dtbcache.v2 index 6d717c4..1333fc6 100644 Binary files a/.vs/BlazorApp1/DesignTimeBuild/.dtbcache.v2 and b/.vs/BlazorApp1/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/BlazorApp1/FileContentIndex/dda027e0-1370-419e-ad8a-e5989e7b85ab.vsidx b/.vs/BlazorApp1/FileContentIndex/dda027e0-1370-419e-ad8a-e5989e7b85ab.vsidx new file mode 100644 index 0000000..73a3bd5 Binary files /dev/null and b/.vs/BlazorApp1/FileContentIndex/dda027e0-1370-419e-ad8a-e5989e7b85ab.vsidx differ diff --git a/.vs/BlazorApp1/FileContentIndex/e4eefed1-7921-4bd5-b76b-4618643f3fd7.vsidx b/.vs/BlazorApp1/FileContentIndex/e4eefed1-7921-4bd5-b76b-4618643f3fd7.vsidx deleted file mode 100644 index 41eed01..0000000 Binary files a/.vs/BlazorApp1/FileContentIndex/e4eefed1-7921-4bd5-b76b-4618643f3fd7.vsidx and /dev/null differ diff --git a/.vs/BlazorApp1/v17/.suo b/.vs/BlazorApp1/v17/.suo index 6c738f6..bc31ecb 100644 Binary files a/.vs/BlazorApp1/v17/.suo and b/.vs/BlazorApp1/v17/.suo differ diff --git a/.vs/ProjectEvaluation/blazorapp1.metadata.v2 b/.vs/ProjectEvaluation/blazorapp1.metadata.v2 index 1e12463..fd34e74 100644 Binary files a/.vs/ProjectEvaluation/blazorapp1.metadata.v2 and b/.vs/ProjectEvaluation/blazorapp1.metadata.v2 differ diff --git a/.vs/ProjectEvaluation/blazorapp1.projects.v2 b/.vs/ProjectEvaluation/blazorapp1.projects.v2 index 35eb0cd..365d93f 100644 Binary files a/.vs/ProjectEvaluation/blazorapp1.projects.v2 and b/.vs/ProjectEvaluation/blazorapp1.projects.v2 differ diff --git a/BlazorApp1/Components/InventoryItem.razor.cs b/BlazorApp1/Components/InventoryItem.razor.cs index 7d44291..a687148 100644 --- a/BlazorApp1/Components/InventoryItem.razor.cs +++ b/BlazorApp1/Components/InventoryItem.razor.cs @@ -74,7 +74,12 @@ namespace BlazorApp1.Components return; } - if (Parent.InventoryItems[this.Index] is not null) + if (this.Index == Parent.CurrentEllement.getIndex()) + { + Parent.InventoryItems[this.Index] = Parent.CurrentDragItem; + Parent.InventoryNbElems[this.Index] = Parent.CurrenttmpNbElem; + } + else if (Parent.InventoryItems[this.Index] is not null) { if (Parent.InventoryItems[this.Index].Equals(Parent.CurrentDragItem)) { @@ -82,17 +87,18 @@ namespace BlazorApp1.Components { Parent.InventoryNbElems[this.Index]++; } - else if (Parent.InventoryNbElems[this.Index] + Parent.CurrentEllement.getNbElement() > Parent.InventoryItems[this.Index].StackSize && Parent.CurrentEllement.getTypeID() == "InventoryItem") + else if (Parent.InventoryNbElems[this.Index] + Parent.CurrenttmpNbElem > Parent.InventoryItems[this.Index].StackSize && Parent.CurrentEllement.getTypeID() == "InventoryItem") { - int tmp = Parent.InventoryNbElems[this.Index] + Parent.CurrentEllement.getNbElement(); + int tmp = Parent.InventoryNbElems[this.Index] + Parent.CurrenttmpNbElem; Parent.InventoryNbElems[this.Index] = Parent.InventoryItems[this.Index].StackSize; - Parent.CurrentEllement.setNbElement(tmp - Parent.InventoryItems[this.Index].StackSize); + Parent.InventoryItems[Parent.CurrentEllement.getIndex()] = Parent.CurrentDragItem; + Parent.InventoryNbElems[Parent.CurrentEllement.getIndex()] =tmp - Parent.InventoryItems[this.Index].StackSize; } else if (Parent.CurrentEllement.getTypeID() == "InventoryItem") { - Parent.InventoryNbElems[this.Index] += Parent.CurrentEllement.getNbElement(); - Parent.CurrentEllement.setNbElement(0); - Parent.CurrentEllement.setItem(null); + Parent.InventoryNbElems[this.Index] += Parent.CurrenttmpNbElem; + //Parent.CurrentEllement.setNbElement(0); + //Parent.CurrentEllement.setItem(null); } else { @@ -121,11 +127,12 @@ namespace BlazorApp1.Components if (Parent.CurrentEllement.getTypeID() == "InventoryItem") { int tmp = Parent.InventoryNbElems[this.Index]; - Parent.InventoryNbElems[this.Index] = Parent.CurrentEllement.getNbElement(); - Parent.CurrentEllement.setNbElement(tmp); + Parent.InventoryNbElems[this.Index] = Parent.CurrenttmpNbElem; + Parent.InventoryNbElems[Parent.CurrentEllement.getIndex()] = tmp; + Item tmpI = Parent.InventoryItems[this.Index]; - Parent.InventoryItems[this.Index] = Parent.CurrentEllement.getItem(); - Parent.CurrentEllement.setItem(tmpI); + Parent.InventoryItems[this.Index] = Parent.CurrentDragItem; + Parent.InventoryItems[Parent.CurrentEllement.getIndex()]=tmpI; } } } @@ -135,16 +142,13 @@ namespace BlazorApp1.Components int tmpNb = Parent.InventoryNbElems[this.Index]; Parent.InventoryItems[this.Index] = Parent.CurrentDragItem; - Parent.InventoryNbElems[this.Index] = Parent.CurrentEllement.getNbElement(); + Parent.InventoryNbElems[this.Index] = Parent.CurrenttmpNbElem; if (Parent.CurrentEllement.getTypeID() == "InventoryItem") { - InventoryItem invItem = (InventoryItem)Parent.CurrentEllement; - Parent.InventoryItems[Parent.CurrentEllement.getIndex()] = tmp; Parent.InventoryNbElems[Parent.CurrentEllement.getIndex()] = tmpNb; - Parent.CurrentEllement = invItem; } else if (Parent.CurrentEllement.getTypeID() == "ListItem") { @@ -160,6 +164,11 @@ namespace BlazorApp1.Components { Parent.CurrentDragItem = Parent.InventoryItems[this.Index]; Parent.CurrentEllement = this; + Parent.CurrenttmpNbElem = Parent.InventoryNbElems[this.Index]; + + Parent.InventoryItems[this.Index] = null; + Parent.InventoryNbElems[this.Index] = 0; + } public int getIndex() diff --git a/BlazorApp1/Components/ListItem.razor.cs b/BlazorApp1/Components/ListItem.razor.cs index e414c20..da4cd71 100644 --- a/BlazorApp1/Components/ListItem.razor.cs +++ b/BlazorApp1/Components/ListItem.razor.cs @@ -69,6 +69,7 @@ namespace BlazorApp1.Components { Parent.CurrentDragItem = this.Item; Parent.CurrentEllement = this; + Parent.CurrenttmpNbElem = 1; } public int getIndex() diff --git a/BlazorApp1/bin/Debug/net6.0/BlazorApp1.dll b/BlazorApp1/bin/Debug/net6.0/BlazorApp1.dll index d20e825..bd912a2 100644 Binary files a/BlazorApp1/bin/Debug/net6.0/BlazorApp1.dll and b/BlazorApp1/bin/Debug/net6.0/BlazorApp1.dll differ diff --git a/BlazorApp1/bin/Debug/net6.0/BlazorApp1.pdb b/BlazorApp1/bin/Debug/net6.0/BlazorApp1.pdb index 8cf1e0e..3449a34 100644 Binary files a/BlazorApp1/bin/Debug/net6.0/BlazorApp1.pdb and b/BlazorApp1/bin/Debug/net6.0/BlazorApp1.pdb differ diff --git a/BlazorApp1/bin/Debug/net6.0/fr-FR/BlazorApp1.resources.dll b/BlazorApp1/bin/Debug/net6.0/fr-FR/BlazorApp1.resources.dll index d2e249a..cc7f942 100644 Binary files a/BlazorApp1/bin/Debug/net6.0/fr-FR/BlazorApp1.resources.dll and b/BlazorApp1/bin/Debug/net6.0/fr-FR/BlazorApp1.resources.dll differ diff --git a/BlazorApp1/obj/Debug/net6.0/BlazorApp1.dll b/BlazorApp1/obj/Debug/net6.0/BlazorApp1.dll index d20e825..bd912a2 100644 Binary files a/BlazorApp1/obj/Debug/net6.0/BlazorApp1.dll and b/BlazorApp1/obj/Debug/net6.0/BlazorApp1.dll differ diff --git a/BlazorApp1/obj/Debug/net6.0/BlazorApp1.pdb b/BlazorApp1/obj/Debug/net6.0/BlazorApp1.pdb index 8cf1e0e..3449a34 100644 Binary files a/BlazorApp1/obj/Debug/net6.0/BlazorApp1.pdb and b/BlazorApp1/obj/Debug/net6.0/BlazorApp1.pdb differ diff --git a/BlazorApp1/obj/Debug/net6.0/fr-FR/BlazorApp1.resources.dll b/BlazorApp1/obj/Debug/net6.0/fr-FR/BlazorApp1.resources.dll index d2e249a..cc7f942 100644 Binary files a/BlazorApp1/obj/Debug/net6.0/fr-FR/BlazorApp1.resources.dll and b/BlazorApp1/obj/Debug/net6.0/fr-FR/BlazorApp1.resources.dll differ diff --git a/BlazorApp1/obj/staticwebassets.pack.sentinel b/BlazorApp1/obj/staticwebassets.pack.sentinel index 45af256..371e595 100644 --- a/BlazorApp1/obj/staticwebassets.pack.sentinel +++ b/BlazorApp1/obj/staticwebassets.pack.sentinel @@ -194,3 +194,8 @@ 2.0 2.0 2.0 +2.0 +2.0 +2.0 +2.0 +2.0