Example #1
0
        public async Task OrderAttackAsync(Guid sceneId, int actorId, int targetX, int targetY)
        {
            var userId = Context.UserIdentifier;
            var scene  = _battleService.GetUserScene(userId, sceneId);

            if (scene != null && scene.GetUserActors(userId).Contains(actorId))
            {
                if (!scene.ActorAttack(actorId, targetX, targetY))
                {
                    await SendUnsuccessfulActionAsync(userId);
                }

                return;
            }

            await SendSynchronizationErrorAsync(userId);
        }