예제 #1
0
        public Task <Player> Create(NewPlayer player)
        {
            Player newPlayer = new Player();

            newPlayer.Name         = player.Name;
            newPlayer.Id           = Guid.NewGuid();
            newPlayer.CreationTime = System.DateTime.Now;
            newPlayer.Level        = player.Level;
            newPlayer.items        = new List <Item>();
            return(_repository.CreatePlayer(newPlayer));
        }
        public async Task <Player> Create(NewPlayer player)
        {
            _logger.LogInformation("Creating player with name " + player.Name);
            Player p = new Player()
            {
                Name = player.Name,
                Id   = Guid.NewGuid()
            };

            p.CreationTime = DateTime.Now;

            await _repository.Create(p);

            return(p);
        }
예제 #3
0
 public Task <Player> Create([FromBody] NewPlayer player)
 {
     return(_processor.Create(player));
 }