예제 #1
0
파일: Item.cs 프로젝트: jamppaman/tehtv
        public Task <Item> CreateItem(Guid playerId, NewItem item)
        {
            Item forward = new Item();

            forward.ItemName     = item.ItemName;
            forward.CreationTime = DateTime.Now;
            forward.Type         = item.Type;
            forward.Level        = 0;
            forward.Id           = Guid.NewGuid();
            return(repository.CreateItem(playerId, forward));
        }
예제 #2
0
        public async Task <Item> CreateItem(Guid playerId, NewItem item)
        {
            Item forward = new Item();

            forward.ItemName = item.ItemName;
            Player owner = await repository.GetPlayer(playerId);

            forward.OwnerName    = owner.Name;
            forward.CreationTime = DateTime.Now;
            forward.Type         = (itemTypes)Enum.Parse(typeof(itemTypes), item.Type);
            forward.Level        = 0;
            forward.Id           = Guid.NewGuid();
            return(await repository.CreateItem(playerId, forward));
        }
예제 #3
0
 public Task <Item> CreateItem(Guid playerId, [FromBody] NewItem item)
 {
     return(processor.CreateItem(playerId, item));
 }