public Task <Player> Create(NewPlayer player)
        {
            Player createPlayer = new Player()
            {
                Id = Guid.NewGuid(), Name = player.Name
            };

            return(_repository.Create(createPlayer));
        }
예제 #2
0
        public static Player Create(NewPlayer newPlayer)
        {
            var createdPlayer = new Player
            {
                Name = newPlayer.Name,
                Tag  = newPlayer.Tag ?? PlayerTag.None
            };

            return(createdPlayer);
        }
예제 #3
0
        public async Task <Player> Create(NewPlayer player)
        {
            Player player1 = new Player();

            player1.Name         = player.Name;
            player1.Id           = Guid.NewGuid();
            player1.CreationTime = DateTime.Today;
            player1.PlayerItems  = new List <Item>();
            return(await _repo.Create(player1));
        }
예제 #4
0
        public async Task <Player> Create(NewPlayer newPlayer)
        {
            var player = new Player()
            {
                Id           = Guid.NewGuid(),
                Name         = newPlayer.Name,
                CreationTime = DateTime.UtcNow
            };


            return(await _IRepo.Create(player));
        }
예제 #5
0
        public Task <Player> Create(NewPlayer player)
        {
            Player p = new Player();

            p.Name         = player.Name;
            p.Id           = Guid.NewGuid();
            p.Score        = 0;
            p.Level        = 0;
            p.IsBanned     = false;
            p.CreationTime = DateTime.Now;
            return(_repoManager.Create(p));
        }
예제 #6
0
        public Task <Player> Create([FromBody] NewPlayer player)
        {
            Player p = new Player();

            p.Name         = player.Name;
            p.Id           = Guid.NewGuid();
            p.Score        = 0;
            p.Level        = player.Level;
            p.IsBanned     = false;
            p.CreationTime = DateTime.UtcNow;
            List <Item> items = new List <Item>();

            //Item[] items = new Item[0];
            p.Items = items;
            return(repo.Create(p));
        }
예제 #7
0
        public Task <Player> Create(NewPlayer player)
        {
            Player newPlayer = new Player();

            newPlayer.Name = player.Name;

            newPlayer.Id = Guid.NewGuid();

            newPlayer.IsBanned = player.IsBanned;

            newPlayer.Level = player.Level;

            newPlayer.Score = player.Score;



            newPlayer.CreationTime = player.CreationTime;


            return(_repository.Create(newPlayer));
        }
 public async Task <Player> Create([FromBody] NewPlayer newPlayer)
 => await playerRepository.Insert(Player.Create(newPlayer));