* Engine namespace changes.
* Automated remove redundant using statements.
* Simplified Graphics namespace.
* Apparently the container system stores full type names in the map file.😞 This updates those names.
* API Changes to LocalizationManager.LoadCulture.
* Update submodule to v0.3.2
33 lines
972 B
C#
33 lines
972 B
C#
using Content.Shared.Maps;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.Map;
|
|
using Robust.Shared.Maths;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Construction.ConstructionConditions
|
|
{
|
|
[UsedImplicitly]
|
|
public class TileNotBlocked : IConstructionCondition
|
|
{
|
|
private bool _filterMobs = false;
|
|
private bool _failIfSpace = true;
|
|
|
|
void IExposeData.ExposeData(ObjectSerializer serializer)
|
|
{
|
|
serializer.DataField(ref _filterMobs, "filterMobs", false);
|
|
serializer.DataField(ref _failIfSpace, "failIfSpace", true);
|
|
}
|
|
|
|
public bool Condition(IEntity user, EntityCoordinates location, Direction direction)
|
|
{
|
|
var tileRef = location.GetTileRef();
|
|
|
|
if (tileRef == null || tileRef.Value.IsSpace())
|
|
return !_failIfSpace;
|
|
|
|
return !tileRef.Value.IsBlockedTurf(_filterMobs);
|
|
}
|
|
}
|
|
}
|