private bool HadNeededItems(Mobile owner, PaintingType paintingType) { Container pack = owner.Backpack; int canvasCount = pack.GetAmount(new Canvas().GetType(), true); int bucketCount = pack.GetAmount(new PaintBucket().GetType(), true); PaintingConsumer paintingConsumer = PaintConsumers.FirstOrDefault(x => x.PaintType == paintingType); if (canvasCount >= paintingConsumer.CanvasCount && bucketCount >= paintingConsumer.PaintBrushCount) { return(true); } owner.SendMessage("You do not have enough resources."); return(false); }
public PaintingConsumer(PaintingType type, int canvasCount, int paintBrushCount) { CanvasCount = canvasCount; PaintBrushCount = paintBrushCount; PaintType = type; }