public IChestItem GetItemFromChest(IChestItem item) { if (!isClosed) { foreach (IChestItem i in ChestInventory) { if (i == item) { IChestItem retItem = i; ChestInventory.Remove(i); return retItem; } } } return null; }
public Chest(ContentManager content, Vector3 position, Vector3 rotation, float scale, Vector3 openFromDirection, IChestItem[] chestItems, bool isClosed = true) : base(@"Models\Environment\ChestClosed", content, position, rotation, scale) { ChestInventory.AddRange(chestItems); this.isClosed = isClosed; closedModel = base.GetModel(); openModel = content.Load<Model>(@"Models\Environment\ChestOpen"); CreateUseAABB(openFromDirection, position, 100, 100); Interactables.AddInteractable(this); emitter = new AudioEmitter(); emitter.Position = position; }
public bool ChestContains(IChestItem item) { return ChestInventory.Contains(item); }