Class RendererUI
Renderer for the UI.
Basically draws the overlay for the currently selected tool over the particles
and forwards the current tool input to the corresponding handler.
Assembly: .dll
Syntax
Constructors
Declaration
public RendererUI(AmoebotSimulator sim, InputController inputController)
Parameters
Fields
Declaration
private bool addToolObjectSelected
Field Value
Declaration
private IObjectInfo addToolSelectedObject
Field Value
currentlyDragging
Declaration
private bool currentlyDragging
Field Value
Declaration
private InputManager input
Field Value
Declaration
private InputController inputController
Field Value
material_hexagonAddObjectOverlay
Declaration
public Material material_hexagonAddObjectOverlay
Field Value
Type |
Description |
Material |
|
material_hexagonAddOverlay
Declaration
public Material material_hexagonAddOverlay
Field Value
Type |
Description |
Material |
|
material_hexagonMoveOverlay
Declaration
public Material material_hexagonMoveOverlay
Field Value
Type |
Description |
Material |
|
material_hexagonMoveSelectionOverlay
Declaration
public Material material_hexagonMoveSelectionOverlay
Field Value
Type |
Description |
Material |
|
material_hexagonRemoveOverlay
Declaration
public Material material_hexagonRemoveOverlay
Field Value
Type |
Description |
Material |
|
material_hexagonSelectionOverlay
Declaration
public Material material_hexagonSelectionOverlay
Field Value
Type |
Description |
Material |
|
material_objectSelectionOverlay
Declaration
public Material material_objectSelectionOverlay
Field Value
Type |
Description |
Material |
|
mesh_baseHexagonBackground
Declaration
public Mesh mesh_baseHexagonBackground
Field Value
Declaration
private Vector2Int moveToolObjectOffset
Field Value
Type |
Description |
Vector2Int |
|
Declaration
private bool moveToolObjectSelected
Field Value
moveToolParticlePosition
Declaration
private Vector2Int moveToolParticlePosition
Field Value
Type |
Description |
Vector2Int |
|
moveToolParticleSelected
Declaration
private bool moveToolParticleSelected
Field Value
Declaration
private IObjectInfo moveToolSelectedObject
Field Value
pSetDragHandler
Declaration
private PSetDragHandler pSetDragHandler
Field Value
sim
Declaration
private AmoebotSimulator sim
Field Value
Methods
ClickActionCallback(ClickAction)
Called when a click or a drag (also ongoing drag) is executed.
Handles all the actions that should be executed when this happens
(e.g., selecting a particle, adding a particle etc.).
Declaration
public void ClickActionCallback(ClickAction action)
Parameters
Type |
Name |
Description |
ClickAction |
action |
The click or drag action that occurred.
|
Render(ViewType)
The render loop of the renderer.
Here the mostly hexagonal overlays are drawn based on the current
state of the renderer UI and the current mouse position.
Declaration
public void Render(ViewType viewType)
Parameters
Type |
Name |
Description |
ViewType |
viewType |
The current view type used to
visualize the particle system.
|
ResetSelection()
Resets the current selection state. This should be
called whenever the system is regenerated in Init Mode.
Declaration
public void ResetSelection()
TryMoveObject(IObjectInfo, Vector2Int)
Declaration
private bool TryMoveObject(IObjectInfo obj, Vector2Int newPos)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
|
Vector2Int |
newPos |
|
Returns
TryRemoveObject(IObjectInfo, Vector2Int, bool)
Tries to remove the given position from the given object.
Should be called by the Remove tool.
If the object only consists of the given position, the
object is removed from the object completely.
Declaration
private void TryRemoveObject(IObjectInfo obj, Vector2Int position, bool showWarning = false)
Parameters
Type |
Name |
Description |
IObjectInfo |
obj |
The object under the cursor.
|
Vector2Int |
position |
The position to be removed.
|
bool |
showWarning |
Whether a warning message should be
displayed when the part of the object cannot be removed.
|
TryRemoveParticle(IParticleState)
Tries to remove the given particle from the system.
Should be called by the Remove tool.
Declaration
private void TryRemoveParticle(IParticleState particle)
Parameters
Type |
Name |
Description |
IParticleState |
particle |
The particle to be removed.
|