コード例 #1
0
        public async Task <AttackResult> Attack(IEntity target, IEntity injurant, HitMethod hitMethod)
        {
            // TODO check distance
            var attackResult = await _hitStrategy.HitCalculateAsync(
                GrainFactory.GetEntity(this).AsImmutable(),
                target.AsImmutable(),
                injurant.AsImmutable(),
                hitMethod);

            return(attackResult.IsEmpty ? AttackResult.Miss() : AttackResult.Hit(attackResult));
        }