Change Offset to take AtmosDirection instead of Direction (#4778)
This commit is contained in:
@@ -143,24 +143,24 @@ namespace Content.Shared.Atmos
|
||||
return (direction & other) == other;
|
||||
}
|
||||
|
||||
public static Vector2i CardinalToIntVec(this Direction dir)
|
||||
public static Vector2i CardinalToIntVec(this AtmosDirection dir)
|
||||
{
|
||||
switch (dir)
|
||||
{
|
||||
case Direction.North:
|
||||
case AtmosDirection.North:
|
||||
return new Vector2i(0, 1);
|
||||
case Direction.East:
|
||||
case AtmosDirection.East:
|
||||
return new Vector2i(1, 0);
|
||||
case Direction.South:
|
||||
case AtmosDirection.South:
|
||||
return new Vector2i(0, -1);
|
||||
case Direction.West:
|
||||
case AtmosDirection.West:
|
||||
return new Vector2i(-1, 0);
|
||||
default:
|
||||
throw new ArgumentException($"Direction dir {dir} is not a cardinal direction", nameof(dir));
|
||||
}
|
||||
}
|
||||
|
||||
public static Vector2i Offset(this Vector2i pos, Direction dir)
|
||||
public static Vector2i Offset(this Vector2i pos, AtmosDirection dir)
|
||||
{
|
||||
return pos + dir.CardinalToIntVec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user