Beispiel #1
0
        public Task <bool> UseRole(Guid eid)
        {
            if (!EntityRepository.Contains(eid))
            {
                return(Task.FromResult(false));
            }

            Entity role = EntityRepository.LoadEntity(eid);

            OnRoleChanging(new RoleChangeArgs {
                Player = Session.Get <Player>(), NewEntity = role
            });
            Session.Set(role);
            EntityManager.AttachEntity(role);
            OnRoleChanged(new RoleChangeArgs {
                Player = Session.Get <Player>(), NewEntity = role
            });

            return(Task.FromResult(true));
        }