Beispiel #1
0
        public void OnGet()
        {
            //关于routeData的数据提取,明天在弄,今天尽量把taghelper的表单部分搞定
            int id = Convert.ToInt32(Request.Query["id"]);

            Game = _repository.Get(id);
        }
Beispiel #2
0
 private async Task <GameItemViewModel> GetItemViewModel(GameItemModel randomItem1)
 {
     return(new GameItemViewModel()
     {
         Cost = randomItem1.Cost,
         Name = await db.GetLocalizationTextAsync(String.Format("DOTA_Tooltip_Ability_{0}", randomItem1.Name)),
         Description = await db.GetLocalizationTextAsync(String.Format("DOTA_Tooltip_ability_{0}_Description", randomItem1.Name)),
         Lore = await db.GetLocalizationTextAsync(String.Format("DOTA_Tooltip_ability_{0}_Lore", randomItem1.Name)),
         Id = randomItem1.Id,
         IsRecipe = randomItem1.IsRecipe,
         SecretShop = randomItem1.IsAvailableAtSecretShop,
         SideShop = randomItem1.IsAvailableAtSideShop,
         IconPath = String.Format("http://cdn.dota2.com/apps/dota2/images/items/{0}_lg.png", randomItem1.IsRecipe ? "recipe" : randomItem1.Name.Replace("item_", "")),
     });
 }
 public AddGameItemCommand(GameItemModel item)
 {
     this.Item = new CreateEntityCommand <GameItemModel>(item);
 }
Beispiel #4
0
 public static string GetIconPath(this GameItemModel item)
 {
     return(String.Format("{0}{1}_lg.png", baseUrl, item.IsRecipe ? "recipe" : item.Name.Replace("item_", "")));
 }
Beispiel #5
0
 public void Add(GameItemModel model)
 {
     _games.Add(model);
 }
Beispiel #6
0
        public Task <GameItemModel> GetGame(Guid id)
        {
            var game = GameItemModel.MapFrom(_gameRepository.GetGame(id));

            return(Task.FromResult(game));
        }
Beispiel #7
0
        public Task <IEnumerable <GameItemModel> > GetItems()
        {
            var allGames = _gameRepository.GetAllGames();

            return(Task.FromResult(allGames.Select(_ => GameItemModel.MapFrom(_)).AsEnumerable()));
        }