示例#1
0
        private async Task <List <GamePlayerBasic> > _GetFilteredGamePlayers(GameInfo gameInfo, GamePlayer callingPlayer)
        {
            List <GamePlayer> players = await _GetGamePlayers(gameInfo.Code);

            return(players.Select(pl =>
            {
                return new GamePlayerBasic(pl)
                {
                    Role = RoleInfo.CanSee(callingPlayer.Role, pl.Role) ? pl.Role : Role.INNOCENT
                };
            }).ToList().FindAll(pl => pl.UserId != callingPlayer.UserId));
        }