Update Docs

master
Louis DUFOUR 2 years ago
parent abab9dbccc
commit b24979ab63

@ -21,7 +21,7 @@ namespace ValblazeProject.Components
public Inventaire Parent { get; set; } public Inventaire Parent { get; set; }
/// <summary> /// <summary>
/// method call when a drag enter a slot and send an action /// appel de la méthode lorsqu'un item entre dans un emplacement et envoie une action
/// </summary> /// </summary>
internal void OnDragEnter() internal void OnDragEnter()
{ {
@ -32,8 +32,9 @@ namespace ValblazeProject.Components
Parent.Actions.Add(new InventoryAction { Action = "Drag Enter", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Enter", Item = this.Item, Index = this.Index });
} }
/// <summary> /// <summary>
/// method call when a drag leave a slot and send an action /// appel de la méthode lorsqu'un item quitte un slot et envoie une action
/// </summary> /// </summary>
internal void OnDragLeave() internal void OnDragLeave()
{ {
@ -44,8 +45,9 @@ namespace ValblazeProject.Components
Parent.Actions.Add(new InventoryAction { Action = "Drag Leave", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Leave", Item = this.Item, Index = this.Index });
} }
/// <summary> /// <summary>
/// method that manage a drop and send an action /// Cette méthode gère le dépôt d'un item et envoie une action
/// </summary> /// </summary>
internal void OnDrop() internal void OnDrop()
{ {
@ -77,8 +79,9 @@ namespace ValblazeProject.Components
} }
/// <summary> /// <summary>
/// method call when darg start and send an action /// appel de la méthode lorsque le darg démarre et envoie une action
/// </summary> /// </summary>
private void OnDragStart() private void OnDragStart()
@ -88,8 +91,9 @@ namespace ValblazeProject.Components
Parent.Actions.Add(new InventoryAction { Action = "Drag Start", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drag Start", Item = this.Item, Index = this.Index });
} }
/// <summary> /// <summary>
/// method call when drag end and send an action specialy when outside the inventory /// Appel de la méthode quand le drag se termine et envoie une action spécialement en dehors de l'inventaire.
/// </summary> /// </summary>
private void OnDragEnd() private void OnDragEnd()
{ {

@ -4,6 +4,12 @@ namespace ValblazeProject.Factories
{ {
public static class ItemFactory public static class ItemFactory
{ {
/// <summary>
///
/// </summary>
/// <param name="item"></param>
/// <param name="imageContent"></param>
/// <returns></returns>
public static ItemModel ToModel(Item item, byte[] imageContent) public static ItemModel ToModel(Item item, byte[] imageContent)
{ {
return new ItemModel return new ItemModel
@ -20,6 +26,11 @@ namespace ValblazeProject.Factories
}; };
} }
/// <summary>
///
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static Item Create(ItemModel model) public static Item Create(ItemModel model)
{ {
return new Item return new Item
@ -37,6 +48,11 @@ namespace ValblazeProject.Factories
}; };
} }
/// <summary>
///
/// </summary>
/// <param name="item"></param>
/// <param name="model"></param>
public static void Update(Item item, ItemModel model) public static void Update(Item item, ItemModel model)
{ {
item.DisplayName = model.DisplayName; item.DisplayName = model.DisplayName;
@ -48,6 +64,12 @@ namespace ValblazeProject.Factories
item.UpdatedDate = DateTime.Now; item.UpdatedDate = DateTime.Now;
item.ImageBase64 = Convert.ToBase64String(model.ImageContent); item.ImageBase64 = Convert.ToBase64String(model.ImageContent);
} }
/// <summary>
///
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public static Item Create(Item model) public static Item Create(Item model)
{ {
return new Item return new Item
@ -65,6 +87,11 @@ namespace ValblazeProject.Factories
}; };
} }
/// <summary>
///
/// </summary>
/// <param name="item"></param>
/// <param name="model"></param>
public static void Update(Item item, Item model) public static void Update(Item item, Item model)
{ {
item.DisplayName = model.DisplayName; item.DisplayName = model.DisplayName;
@ -78,6 +105,11 @@ namespace ValblazeProject.Factories
item.Num = model.Num; item.Num = model.Num;
} }
/// <summary>
/// Ajoute le numéro a un item
/// </summary>
/// <param name="item"></param>
/// <param name="model"></param>
public static void Add1(Item item, Item model) public static void Add1(Item item, Item model)
{ {
item.Num = model.Num + 1; item.Num = model.Num + 1;

@ -14,9 +14,15 @@ namespace ValblazeProject.Pages
public partial class Inventaire public partial class Inventaire
{ {
/******************* Initialisation des attributs *******************/ /******************* Initialisation des attributs *******************/
/// <summary>
/// Pour traduire la page
/// </summary>
[Inject] [Inject]
public IStringLocalizer<List> Localizer { get; set; } public IStringLocalizer<List> Localizer { get; set; }
/// <summary>
/// Data de l'API
/// </summary>
[Inject] [Inject]
public IDataService DataService { get; set; } public IDataService DataService { get; set; }
@ -26,23 +32,35 @@ namespace ValblazeProject.Pages
[Inject] [Inject]
internal IJSRuntime JavaScriptRuntime { get; set; } internal IJSRuntime JavaScriptRuntime { get; set; }
/// <summary>
/// Ma liste d'Item
/// </summary>
public List<Item> items { get; set; } = new List<Item>(); public List<Item> items { get; set; } = new List<Item>();
private int totalItem;
// List inventaire sauvegarder /// <summary>
/// List inventaire sauvegarder
/// </summary>
public List<Item> Jitems; public List<Item> Jitems;
/// <summary>
/// Donnée de la Grid Blazorise
/// </summary>
private DataGrid<Item> dataGrid; private DataGrid<Item> dataGrid;
private string _searchText;
private int totalSizeByPage = 5;
private bool _trie = false;
// Gestion logs /// <summary>
/// Liste des actions
/// </summary>
public ObservableCollection<InventoryAction> Actions { get; set; } public ObservableCollection<InventoryAction> Actions { get; set; }
// Drag Item /// <summary>
/// Item selectionner lors d'un glisser déposer
/// </summary>
public Item CurrentDragItem { get; set; } public Item CurrentDragItem { get; set; }
private int totalItem;
private string _searchText;
private int totalSizeByPage = 5;
private bool _trie = false;
/******************* Attribut modifier *******************/ /******************* Attribut modifier *******************/
private string search private string search
@ -92,6 +110,7 @@ namespace ValblazeProject.Pages
/// <param name="e"></param> /// <param name="e"></param>
private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) private void OnActionsCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{ {
// je fais appel au fichier js de crafting, car je n'ai pas su résoudre le problème avec celui Inventaire.razor.js
JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems); JavaScriptRuntime.InvokeVoidAsync("Crafting.AddActions", e.NewItems);
} }

Loading…
Cancel
Save