Class RemoveTool
A tool is a type of game mode that is currently active. Tools are split up into the PlayModeTool and BuildTools, the latter of which holds all tools that can be found in the build menu.
public class RemoveTool : Tool
- Inheritance
-
RemoveTool
- Inherited Members
- Extension Methods
Constructors
RemoveTool()
public RemoveTool()
Methods
CanUndoRedo()
Returns whether or not the UndoRedoStack can currently operate and thus, whether the Undo() or Redo() actions can be called.
public override bool CanUndoRedo()
Returns
- bool
Whether the undo or redo commands can be used right now.
Draw(GameTime, SpriteBatch, bool)
This method is called every draw frame for the CurrentTool. By default, this method invokes OnDraw.
public override void Draw(GameTime time, SpriteBatch batch, bool cursorOnUi)
Parameters
time
GameTimeThe game's time
batch
SpriteBatchThe sprite batch used for drawing
cursorOnUi
boolWhether the cursor is currently covering the ui.
GetMouseCursor()
Returns the CursorType that this tool should currently display. By default, Default is returned.
public override CursorType GetMouseCursor()
Returns
- CursorType
The cursor type
PlayDestroySound()
Plays the destroy sound
public static void PlayDestroySound()
RemoveFurniture(Furniture, UndoableAction)
Removes the given furniture from the world, additionally removing all of its GetChildren<T>() and adding the required amount of Money Note that the furniture's parent-child relationships are not edited or removed, so UnlinkParentsAndChildren() should be called if the furniture is added into a household storage or similar.
public static bool RemoveFurniture(Furniture furniture, UndoableAction action)
Parameters
furniture
FurnitureThe furniture item to remove
action
UndoableActionThe undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.
Returns
- bool
Whether the removal was a success, which is only false if the passed
furniture
has the NonSellable category
RemoveNonGroundTile(Point, int, UndoableAction)
Removes the given non-ground tile from the map, restores the appropriate amount of money, remoevs any furniture that was on the ground, and spawns the appropriate particles.
public static bool RemoveNonGroundTile(Point pos, int floor, UndoableAction action)
Parameters
pos
PointThe position of the tile to remove.
floor
intThe floor of the tile to remove.
action
UndoableActionThe undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.
Returns
- bool
Whether the tile will be successfully removed as part of the
action
.
RemoveRoof(Roof, UndoableAction, Rectangle?)
Removes the given roof from the world, additionally removing any CeilingHanging furniture below it and returning the money for the objects
public static void RemoveRoof(Roof roof, UndoableAction action, Rectangle? newRoof = null)
Parameters
roof
RoofThe roof to remove
action
UndoableActionThe undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.
newRoof
Rectangle?The area of a roof that replaces this one, or null if this roof is just being removed without a replacement.
RemoveStairs(Stairs, UndoableAction)
Removes the given stairs from the world and refunds the appropriate amount of money.
public static void RemoveStairs(Stairs stairs, UndoableAction action)
Parameters
stairs
StairsThe stairs to remove.
action
UndoableActionThe undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.
RemoveWall(WallLike, UndoableAction)
Removes the given wall from the world, additionally removing any hanging Furniture and adding the required amount of Money
public static void RemoveWall(WallLike wall, UndoableAction action)
Parameters
wall
WallLikeThe wall to remove
action
UndoableActionThe undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.
ShouldHighlightSelectedObject(object)
Whether or not the SelectedObject should currently have a white highlight around it. This method defaults to return true if IsCursorOnUi() is false.
public override bool ShouldHighlightSelectedObject(object obj)
Parameters
Returns
- bool
Whether or not the selected object should be highlighted
SpawnDestroyParticles(RectangleF, float, float, params (TextureRegion, Color)[])
Spawns a set of particles for an arbitrary object being destroyed. If a Furniture is destroyed, SpawnDestroyParticles(Furniture) should be used instead.
public static void SpawnDestroyParticles(RectangleF area, float floor, float amountMultiplier, params (TextureRegion, Color)[] textures)
Parameters
area
RectangleFThe area to spawn particles in.
floor
floatThe floor to spawn particles on.
amountMultiplier
floatThe amount of particles that should be spawned, which will be multiplied with the size of the
area
textures
(TextureRegion, Color)[]The textures and their colors to choose from when spawning the particles.
SpawnDestroyParticles(Furniture)
Spawns a set of particles for the given Furniture being destroyed. The particles are based on the furniture's textures and colors.
public static void SpawnDestroyParticles(Furniture furniture)
Parameters
furniture
FurnitureThe furniture whose particles to spawn.
SpawnDestroyParticles(WallLike)
Spawns a set of particles for the given WallLike object being destroyed. The particles are based on the item's textures and colors.
public static void SpawnDestroyParticles(WallLike wall)
Parameters
wall
WallLikeThe wall whose particles to spawn.
StoreOrRemoveFurniture(Furniture, UndoableAction)
Stores the passed Furniture into the current household's FurnitureStorage, or, if there is no current household, removes the object using RemoveFurniture(Furniture, UndoableAction) instead. If the passed furniture is in the world and has children, the children are also stored (or removed) recursively.
public static bool StoreOrRemoveFurniture(Furniture furniture, UndoableAction action)
Parameters
furniture
FurnitureThe furniture to store (or remove)
action
UndoableActionThe undoable action that this method should add its actions to. If this method should be executed immediately, use the UndoableAction immediate constructor.
Returns
- bool
Whether the storage or removal was a success, which is only false if there is no current household and the passed
furniture
has the NonSellable category
Update(GameTime, bool)
This method is called every update frame for the CurrentTool. By default, this method updates the MousePos and invokes OnUpdate, and also manages the UndoRedoStack.
public override void Update(GameTime time, bool cursorOnUi)
Parameters
time
GameTimeThe game's time
cursorOnUi
boolWhether the cursor is currently covering the ui.