qud-mods/AutoDropBedding/Extensions.cs

31 lines
708 B
C#
Raw Permalink Normal View History

2023-12-19 01:24:51 -05:00
using System;
using System.Collections.Generic;
using XRL.World;
// maybe this is a little extra but whatever
namespace AutoDropBedding
{
public static class Extensions
{
// todo: find other things that set bedding on fire
private static readonly List<string> Firestarters = new List<string>() {"Campfire", "BlueCampfire"};
public static bool HasAnyLiquid(this Cell cell)
{
foreach (var _ in cell.GetObjects(o => o.HasPart("LiquidVolume")))
return true;
return false;
}
public static bool HasFirestarter(this Cell cell)
{
foreach (string thing in Firestarters)
{
if (cell.HasObject(thing))
return true;
}
return false;
}
}
}