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); }
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); }
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); }
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"); }
public IndexModel(IItemApi itemApi, IRoomApi roomApi, IReservationApi reservationApi) { _itemApi = itemApi; _roomApi = roomApi; _reservationApi = reservationApi; }