Table of Contents

Class MoveLotTool

Namespace
TinyLife.Tools
Assembly
Tiny Life.dll

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 MoveLotTool : Tool
Inheritance
MoveLotTool
Inherited Members
Extension Methods

Constructors

MoveLotTool()

public MoveLotTool()

Methods

CanSwitchGameModes()

Whether or not the game CanSwitchGameModes() currently, while this tool is selected

public override bool CanSwitchGameModes()

Returns

bool

Whether the game can be mode switched right now

CanUndoRedo(bool)

Returns whether or not the UndoRedoStack can currently operate and thus, whether the Undo() or Redo() actions can be called.

public override bool CanUndoRedo(bool cursorOnUi)

Parameters

cursorOnUi bool

Returns

bool

Whether the undo or redo commands can be used right now.

Closed()

Called when this build tool is closed. By default, this method removes its elements from the ui.

public override void Closed()

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 GameTime

The game's time

batch SpriteBatch

The sprite batch used for drawing

cursorOnUi bool

Whether the cursor is currently covering the ui.

Draw(ExportedLot, Point, GameTime, SpriteBatch, bool)

Draws the given ExportedLot.

public static void Draw(ExportedLot lot, Point offset, GameTime time, SpriteBatch batch, bool checkValid)

Parameters

lot ExportedLot

The lot to draw.

offset Point

The offset to draw the lot with, based on its top-left corner.

time GameTime

The time to draw with.

batch SpriteBatch

The sprite batch to draw with.

checkValid bool

Whether objects that cannot be placed at the current location should be drawn in red, rather than their default color.

GetMouseCursor()

Returns the CursorType that this tool should currently display. By default, Default is returned.

public override CursorType GetMouseCursor()

Returns

CursorType

The cursor type

Move(ExportedLot, Point)

Moves the given ExportedLot in-place by the given offset.

public static void Move(ExportedLot lot, Point offset)

Parameters

lot ExportedLot

The lot to move.

offset Point

The offset to move the lot by.

Opened()

Called when this build tool is opened. By default, this method initializes several settings and calls InitBuildModeUi(Panel, Panel).

public override void Opened()

Rotate(ExportedLot, Point)

Rotates the given ExportedLot in-place by 90 degrees clockwise.

public static void Rotate(ExportedLot lot, Point offset)

Parameters

lot ExportedLot

The lot to rotate.

offset Point

An offset that should be applied around which to rotate (relative to the top-left corner of the lot).

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

obj object

The selected object, which can be a MapObject or a WallLike.

Returns

bool

Whether or not the selected object should be highlighted

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 GameTime

The game's time

cursorOnUi bool

Whether the cursor is currently covering the ui.