Example #1
0
        public Task <Player> Create(NewPlayer player)
        {
            Player p = new Player();

            p.Name         = player.Name;
            p.Id           = Guid.NewGuid();
            p.CreationTime = DateTime.Now;
            return(repo.Create(p));
        }
        public async Task <Player> Create(NewPlayer newPlayer)
        {
            var player = new Player()
            {
                Id           = Guid.NewGuid(),
                Name         = newPlayer.Name,
                CreationTime = DateTime.UtcNow
            };

            return(await _IRepo.CreatePlayer(player));
        }
Example #3
0
        public async Task <Player> Create(NewPlayer player)
        {
            var    rand = new Random();
            Player asd  = new Player();

            asd.Name = player.Name;
            asd.Id   = Guid.NewGuid();

            asd.Score = rand.Next(999999);

            asd.Level    = rand.Next(99);
            asd.IsBanned = false;
            DateTime now = DateTime.Now;

            asd.CreationTime = now;
            pellaaja.Add(asd);

            await _repository.Create(asd);

            return(asd);
        }
Example #4
0
 public Task <Player> Create([FromBody] NewPlayer player)
 {
     return(processor.Create(player));
 }