public Item(Game game, EnumTipoItem tpItem) : base(game) { TipoItem = tpItem; Texture = game.Content.Load <Texture2D>("2d/arma"); game.Components.Add(this); }
public Item(int id, string nome, string descricao, Efeito efeito, Sprite imagem) { this.id = id; this.nome = nome; this.descricao = descricao; this.efeito = efeito; this.imagem = imagem; this.tipo = EnumTipoItem.Artefato; }
public Item(string nome, string descricao, EnumTipoItem tipo, float valor, float peso, float defesa, float ataque, Sprite imagem, Mesh modelo, float cura, int id, float mana) { this.nome = nome; this.descricao = descricao; this.tipo = tipo; this.valor = valor; this.peso = peso; this.defesa = defesa; this.ataque = ataque; this.imagem = imagem; this.modelo = modelo; this.cura = cura; this.id = id; this.mana = mana; }
public Item(string nome, string descricao, double valor, string foto, EnumTipoItem tipo, Empresa empresa) { Nome = nome; Descricao = descricao; Valor = valor; Foto = foto; Tipo = tipo; Empresa = empresa; new AddNotifications <Item>(this) .IfNullOrInvalidLength(x => x.Nome, 3, 60, "O Nome do prato deve conter 3 à 60 caracteres") .IfNullOrInvalidLength(x => x.Descricao, 3, 200, "A descrição deve conter 3 à 200 caracteres"); Ativo = true; DataCadastro = DateTime.Now; }
public void Interagir() { EnumTipoItem tipo = Itens.item [id].Tipo; switch (tipo) { case EnumTipoItem.Armadura: PlayerManager.instance.GetComponent <Inventario> ().Armadura = id; break; case EnumTipoItem.Arma: PlayerManager.instance.GetComponent <Inventario> ().Arma = id; break; case EnumTipoItem.Consumivel: if (Itens.item [id].Cura != 0) { PlayerManager.instance.GetComponent <PlayerStatus> ().Vida += Itens.item [id].Cura; } if (Itens.item [id].Mana != 0) { PlayerManager.instance.GetComponent <PlayerStatus> ().Mana += Itens.item [id].Mana; } PlayerManager.instance.GetComponent <Inventario> ().Bolsa.Remove(id); break; case EnumTipoItem.Artefato: PlayerManager.instance.GetComponent <Inventario> ().Artefato = id; System.Type type = Itens.item [id].Efeito.GetType(); Component comp = PlayerManager.instance.GetComponent <Inventario> ().artefatoGO.AddComponent(type); ((Efeito)comp).id = id; break; } if (info != null) { info.SetActive(false); } PlayerManager.instance.GetComponent <InterfaceManager> ().inventarioUI.AtualizarInventario(); }
public async Task <IActionResult> GetCardapio([FromQuery] RetornarCardapioMesaRequest request, string id, [FromQuery] EnumTipoItem tipo) { try { request.FkMesa = Guid.Parse(id); request.Tipo = tipo; var response = await _mediator.Send(request, CancellationToken.None); return(await ResponseAsync(response)); } catch (System.Exception ex) { return(BadRequest(ex.Message)); } }
public DataTableResponseBase <Item> ItensEmpresaDatatable(DataTableBase <Item> dataTableBase, Guid FkEmpresa, EnumTipoItem tipo) { var query = _context.Set <Item>() .Where(x => x.Tipo == tipo) .Where(x => x.Empresa.Id == FkEmpresa).AsQueryable(); if (dataTableBase.Filter != null && dataTableBase.Filter != string.Empty) { query = query.Where(e => e.Nome.Contains(dataTableBase.Filter) || e.Descricao.Contains(dataTableBase.Filter)); } int count = query.Count(); query = query.OrderBy(x => x.Nome); query = query.Skip(dataTableBase.PageNumber * dataTableBase.PageView).Take(dataTableBase.PageView); DataTableResponseBase <Item> resp = new DataTableResponseBase <Item>(count, dataTableBase.PageView, dataTableBase.PageNumber, query.ToList()); return(resp); }