31 lines
708 B
C#
31 lines
708 B
C#
|
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;
|
||
|
}
|
||
|
}
|
||
|
}
|