public ExtendedSpellDto(SpellEntity spell, SpellElementEntity spellElement) { this.id = spell.id; this.name = spell.name; this.elementName = spellElement.name; this.cost = spell.cost; }
public IActionResult PutSpellEntity(int id, SpellEntity spell) { if (id != spell.id) { return(BadRequest()); } _context.Entry(spell).State = EntityState.Modified; try { _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpellEntityExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult <SpellEntity> PostSpellEntity(SpellEntity spell) { _context.spell.Add(spell); _context.SaveChanges(); //return CreatedAtAction("GetSpellEntity", new { id = spellEntity.id }, spellEntity); return(Ok(spell)); }
private void Cast() { if (caster && caster.unit) { caster.unit.PayManaCost(this); } currentCooldown = cooldown; GameObject spellObject = GameObject.Instantiate(spellEntityPrefab.gameObject, caster ? caster.transform.position : pointTarget, Quaternion.identity); SpellEntity spell = spellObject.GetComponent <SpellEntity>(); spell.caster = caster; spell.actorTarget = actorTarget; spell.pointTarget = pointTarget; }
/// <summary> /// Converts the domain model into an entity. /// </summary> /// <returns>The entity.</returns> /// <param name="spell">Spell.</param> internal static SpellEntity ToEntity(this Spell spell) { SpellEntity spellEntity = new SpellEntity { Id = spell.Id, Name = spell.Name, Description = spell.Description, RequiredLevel = spell.RequiredLevel, Type = spell.Type, RuneCount = spell.RuneCount, RequiredRunesIds = spell.RequiredRunesIds, RequiredRunesCounts = spell.RequiredRunesCounts, ExperienceGain = spell.ExperienceGain }; return(spellEntity); }
/// <summary> /// Converts the entity into a domain model. /// </summary> /// <returns>The domain model.</returns> /// <param name="spellEntity">Spell entity.</param> internal static Spell ToDomainModel(this SpellEntity spellEntity) { Spell spell = new Spell { Id = spellEntity.Id, Name = spellEntity.Name, Description = spellEntity.Description, RequiredLevel = spellEntity.RequiredLevel, Type = spellEntity.Type, RuneCount = spellEntity.RuneCount, RequiredRunesIds = spellEntity.RequiredRunesIds, RequiredRunesCounts = spellEntity.RequiredRunesCounts, ExperienceGain = spellEntity.ExperienceGain }; return(spell); }