-
Notifications
You must be signed in to change notification settings - Fork 0
/
Armazem
29 lines (24 loc) · 825 Bytes
/
Armazem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
internal class Armazem
{
internal string Localizacao;
internal string AreaM2;
internal List<(Produto produto, int quantidade)> ProdutosEmEstoque = new List<(Produto, int)>();
internal Armazem(string localizacao, string areaM2, List<Produto> listaProduto)
{
Localizacao = localizacao;
AreaM2 = areaM2;
foreach (var produto in listaProduto)
{
ProdutosEmEstoque.Add((produto, 0));
}
}
internal int GetEstoqueDeProduto(Guid UUID)
{
return ProdutosEmEstoque.Find(x => x.produto.UUID == UUID).quantidade;
}
internal void AdicionarEstoqueProduto(Guid UUID, int quantidade)
{
int _indice = ProdutosEmEstoque.FindIndex(x => x.produto.UUID == UUID);
ProdutosEmEstoque[_indice].quantidade += quantidade;
}
}