public void UpdateFromRapidCombination(CombinationConsumable5.ResultModel result, long requiredIndex) { var mail = mailBox.First(m => m.id == result.id); mail.requiredBlockIndex = requiredIndex; var item = inventory.Items .Select(i => i.item) .OfType <ItemUsable>() .First(i => i.ItemId == result.itemUsable.ItemId); item.Update(requiredIndex); }
public void Execute(bool backward) { const int slotStateUnlockStage = 1; var avatarState = _initialState.GetAvatarState(_avatarAddress); avatarState.worldInformation = new WorldInformation( 0, _initialState.GetSheet <WorldSheet>(), slotStateUnlockStage); var row = _tableSheets.MaterialItemSheet.Values.First(r => r.ItemSubType == ItemSubType.Hourglass); avatarState.inventory.AddItem(ItemFactory.CreateMaterial(row), 83); avatarState.inventory.AddItem(ItemFactory.CreateTradableMaterial(row), 100); Assert.True(avatarState.inventory.HasFungibleItem(row.ItemId, 0, 183)); var firstEquipmentRow = _tableSheets.EquipmentItemSheet.First; Assert.NotNull(firstEquipmentRow); var gameConfigState = _initialState.GetGameConfigState(); var requiredBlockIndex = gameConfigState.HourglassPerBlock * 200; var equipment = (Equipment)ItemFactory.CreateItemUsable( firstEquipmentRow, Guid.NewGuid(), requiredBlockIndex); avatarState.inventory.AddItem(equipment); var result = new CombinationConsumable5.ResultModel { actionPoint = 0, gold = 0, materials = new Dictionary <Material, int>(), itemUsable = equipment, recipeId = 0, itemType = ItemType.Equipment, }; var mail = new CombinationMail(result, 0, default, requiredBlockIndex);
public CombinationMail(CombinationConsumable5.ResultModel attachmentActionResult, long blockIndex, Guid id, long requiredBlockIndex) : base(attachmentActionResult, blockIndex, id, requiredBlockIndex) { }