Exemple #1
0
    private void Start()
    {
        _screenBounds = GameManager.GetScreenBounds;

        var itemSize   = ListItem.Length;
        int randomItem = Random.Range(0, itemSize - 1);

        _dispenserItem = ListItem[randomItem];
    }
Exemple #2
0
        public async Task AddItemToDispenserAsync(Guid itemId, Guid dispenserId, CancellationToken cancellationToken = default)
        {
            var dispenserItem = new DispenserItem
            {
                ItemId      = itemId,
                DispenserId = dispenserId
            };
            await toolShedContext.DispenserItemSet
            .AddAsync(dispenserItem);

            await toolShedContext.SaveChangesAsync(cancellationToken);
        }
Exemple #3
0
 public async Task RemoveItemFromDispensery(DispenserItem dispenserTool, CancellationToken cancellationToken = default)
 {
     toolShedContext.DispenserItemSet
     .Remove(dispenserTool);
     await toolShedContext.SaveChangesAsync(cancellationToken);
 }
 public DispenserItemRepositoryTests()
 {
     dispenserItemRepository = GetInMemoryDispenserItemRepository();
     dispenserItem           = CreateDispenserItem();
 }
Exemple #5
0
 public void Setup(ref DispenserItem dispenserItem)
 {
     _spriteRenderer.sprite = dispenserItem.ItemSprite;
     ItemType = dispenserItem.Type;
 }