public GameParticipant GetGit(PartOfBody attackedPart) { if (attackedPart == blocked) { return(Block(this, attackedPart)); } return(TakeWound(this)); }
public User GetGit(PartOfBody attackedPart) { if (attackedPart == blocked) { return(Block(this, attackedPart)); } return(TakeWound(this)); }
public async Task <int> AddAsync(string name, string partOfBody) { var exercise = await _exerciseRepository.CheckIfExistsAsync(name); exercise = new Exercise(name, PartOfBody.GetPart(partOfBody)); await _exerciseRepository.AddAsync(exercise); return(exercise.Id); }
public new void GetHit(PartOfBody point, int dm) { SetBlock(GetBlock()); switch (point) { case PartOfBody.Head: hits[0] += 1; break; case PartOfBody.Body: hits[1] += 1; break; case PartOfBody.Legs: hits[2] += 1; break; } base.GetHit(point, dm); }
public void GetHit(PartOfBody pob) { if (pob == Blocked) { onBlock(this, new GamerArgs(this.Name, this.Hp)); } else { this.Hp -= 20; onWound(this, new GamerArgs(this.Name, this.Hp)); if (this.Hp <= 0) { onDeath(this, new GamerArgs(this.Name, this.Hp)); } } }
public async Task UpdateAsync(int id, string name, string partOfBody) { var exercise = await _exerciseRepository.GetOrFailAsync(id); // If exercise has the same name, ensure that name will be searching for exercise with this name if (await _exerciseRepository.AnyAsync(p => p.Name == name)) { if (exercise.Name != name) { throw new NameInUseException(nameof(Exercise), name); } } exercise.SetName(name); exercise.PartOfBody.Id = PartOfBody.GetPart(partOfBody).Id; await _exerciseRepository.UpdateAsync(exercise); }
public async Task <PagedList <Exercise> > GetAllAsync(string name, string partOfBody, PaginationQuery paginationQuery) { IQueryable <Exercise> query = _context.Exercises.Include(e => e.PartOfBody) .AsNoTracking(); if (name is not null) { query = query.Where(e => e.Name.Contains(name)); } if (partOfBody is not null) { query = query.Where(e => e.PartOfBody.Name == PartOfBody.GetPart(partOfBody).Name); } return(await PagedList <Exercise> .ToPagedList(query.OrderBy(e => e.Name), paginationQuery.PageNumber, paginationQuery.PageSize)); }
/*Аватар получает оплеуху, аватар оценивет получил он урон или взошла сегодня его счастливая звезда * Если заблокировал, то логично вылетает событие Block, и так далее, то безвременой кончины */ public void GetHit(PartOfBody point, int dm) { if (point == blocked) { Block(name, hp); } else { hp -= dm; if (hp <= 0) { Death(name, hp); } else { Wound(name, hp); } } }
public void SetBlock(PartOfBody blockedPart) { blocked = blockedPart; }
private GameParticipant BlockHandler(GameParticipant user, PartOfBody blockedPart) { logsForm.UpdateLogs(user.name + " blocked the attack, " + blockedPart + " kick blocked \r"); return(user); }
private new void SetBlock(PartOfBody block) { this.blocked = block; }
/* Устанавливает блок из вне, то есть блок ставит пользователь и его запоминает аватар*/ public void SetBlock(PartOfBody block) { this.blocked = block; }
private User BlockHandler(User user, PartOfBody blockedPart) { LogsRichTextBox.Text += user.name + " blocked the attack, " + blockedPart + " kick blocked \r"; return(user); }
public void SetBlock(PartOfBody pob) { Blocked = pob; }
public async Task AddPartOfBody(PartOfBody p) { await db.PartsOfBody.AddAsync(p); }