You can now pry multiple tiles at once (#29231)
* You can now pry multiple tiles at once * More advanced do after duplicate checking. Instead of just saying "lol tile prying can raise duplicates", we now have a system so tile prying can properly distinguish events on 2 different tiles. This is achieved with a virtual function on DoAfterEvent.
This commit is contained in:
committed by
GitHub
parent
d15eafe133
commit
cf374ac905
@@ -30,15 +30,24 @@ public sealed partial class ToolTileCompatibleComponent : Component
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class TileToolDoAfterEvent : DoAfterEvent
|
||||
{
|
||||
public NetCoordinates Coordinates;
|
||||
public NetEntity Grid;
|
||||
public Vector2i GridTile;
|
||||
|
||||
public TileToolDoAfterEvent(NetCoordinates coordinates)
|
||||
public TileToolDoAfterEvent(NetEntity grid, Vector2i gridTile)
|
||||
{
|
||||
Coordinates = coordinates;
|
||||
Grid = grid;
|
||||
GridTile = gridTile;
|
||||
}
|
||||
|
||||
public override DoAfterEvent Clone()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
public override bool IsDuplicate(DoAfterEvent other)
|
||||
{
|
||||
return other is TileToolDoAfterEvent otherTile
|
||||
&& Grid == otherTile.Grid
|
||||
&& GridTile == otherTile.GridTile;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user