コード例 #1
0
        public async Task GetItemClassesIndexAsync_Gets_ItemClassesIndex()
        {
            IItemApi warcraftClient = ClientFactory.BuildMockClient(
                requestUri: "https://us.api.blizzard.com/data/wow/item-class/index?namespace=static-us&locale=en_US",
                responseContent: Resources.ItemClassesIndexResponse);

            RequestResult <ItemClassesIndex> result = await warcraftClient.GetItemClassesIndexAsync("static-us");

            Assert.NotNull(result.Value);
        }
コード例 #2
0
        public async void GetItemSetAsync_Gets_ItemSet()
        {
            IItemApi warcraftClient = ClientFactory.BuildMockClient(
                requestUri: "https://us.api.blizzard.com/data/wow/item-set/1?namespace=static-us&locale=en_US",
                responseContent: Resources.ItemSetResponse);

            RequestResult <ItemSet> result = await warcraftClient.GetItemSetAsync(1, "static-us");

            Assert.NotNull(result.Value);
        }
コード例 #3
0
        public async Task GetItemMediaAsync_Gets_Item()
        {
            IItemApi warcraftClient = ClientFactory.BuildMockClient(
                requestUri: "https://us.api.blizzard.com/data/wow/media/item/19019?namespace=static-us&locale=en_US",
                responseContent: Resources.ItemMediaResponse);

            RequestResult <ItemMedia> result = await warcraftClient.GetItemMediaAsync(19019, "static-us");

            Assert.NotNull(result.Value);
        }
コード例 #4
0
        private void RegisterMachines(ICoreApi coreApi)
        {
            this.Monitor.Log("Registering machines...", LogLevel.Info);
            IItemApi itemApi = coreApi.Items;

            // Stone converter
            TextureInformation    textureInfo    = new TextureInformation(Game1.bigCraftableSpriteSheet, new Rectangle(16 * 3, 32 * 2, 16, 32));
            StoneConverterMachine stoneConverter = new StoneConverterMachine(this, "stoneConverter", textureInfo);

            itemApi.Register("stoneConverter", stoneConverter);

            // TODO: debug
            this.Helper.Events.Input.ButtonPressed += (sender, args) => {
                if (args.Button == SButton.NumPad3 && itemApi.TryGetInformation("stoneConverter", out IObjectInformation info) && info.Index is int index)
                {
                    SObject machine = new SObject(Vector2.Zero, index, false);
                    Game1.player.addItemToInventory(machine);
                }
            };

            this.Monitor.Log("Done");
        }
コード例 #5
0
ファイル: Index.cshtml.cs プロジェクト: kaanaydemir/Dephion
 public IndexModel(IItemApi itemApi, IRoomApi roomApi, IReservationApi reservationApi)
 {
     _itemApi        = itemApi;
     _roomApi        = roomApi;
     _reservationApi = reservationApi;
 }